Type TSDocxShading = Class(TSVbaBase) Uses TSDocxEnumerations; public Function Init(pr); private pr_; // xxPr对象,比如Cell: tr.tcPr,或Paragraph: p.pPr public property BackgroundPatternColor read ReadBackgroundPatternColor write WriteBackgroundPatternColor; property BackgroundPatternColorIndex read ReadBackgroundPatternColorIndex write WriteBackgroundPatternColorIndex; property ForegroundPatternColor read ReadForegroundPatternColor write WriteForegroundPatternColor; property ForegroundPatternColorIndex read ReadForegroundPatternColorIndex write WriteForegroundPatternColorIndex; property Texture read ReadTexture write WriteTexture; Function WriteTexture(texture); Function ReadTexture(); Function WriteForegroundPatternColorIndex(); Function ReadForegroundPatternColorIndex(); Function WriteForegroundPatternColor(); Function ReadForegroundPatternColor(); Function WriteBackgroundPatternColorIndex(); Function ReadBackgroundPatternColorIndex(); Function WriteBackgroundPatternColor(); Function ReadBackgroundPatternColor(); End; // ============== 实现 ================= // Function TSDocxShading.Init(pr); Begin pr_ := pr; End; // property Function TSDocxShading.WriteTexture(texture); Begin case texture of TSDocxEnumerations.wdTextureHorizontal(): begin pr_.Shading.Val := "thinHorzStripe"; pr_.Update(); end end; End; Function TSDocxShading.ReadTexture(); Begin End;