Word.ShadingTextureType enum   
表示底纹纹理。 若要详细了解如何应用背景(如纹理),请参阅在 Word 中添加、更改或删除背景色。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-styles.yaml
// Updates shading properties (e.g., texture, pattern colors) of the specified style.
await Word.run(async (context) => {
  const styleName = (document.getElementById("style-name") as HTMLInputElement).value;
  if (styleName == "") {
    console.warn("Enter a style name to update shading properties.");
    return;
  }
  const style: Word.Style = context.document.getStyles().getByNameOrNullObject(styleName);
  style.load();
  await context.sync();
  if (style.isNullObject) {
    console.warn(`There's no existing style with the name '${styleName}'.`);
  } else {
    const shading: Word.Shading = style.shading;
    shading.load();
    await context.sync();
    shading.backgroundPatternColor = "blue";
    shading.foregroundPatternColor = "yellow";
    shading.texture = Word.ShadingTextureType.darkTrellis;
    console.log("Updated shading.");
  }
});
	字段
| darkDiagonalDown = "DarkDiagonalDown" | 表示深色对角线下纹理。  | 
				
| darkDiagonalUp = "DarkDiagonalUp" | 表示深色对角线向上纹理。  | 
				
| darkGrid = "DarkGrid" | 表示深色水平交叉纹理。  | 
				
| darkHorizontal = "DarkHorizontal" | 表示深色水平纹理。  | 
				
| darkTrellis = "DarkTrellis" | 表示深对角线交叉纹理。  | 
				
| darkVertical = "DarkVertical" | 表示深色垂直纹理。  | 
				
| lightDiagonalDown = "LightDiagonalDown" | 表示浅对角线向下纹理。  | 
				
| lightDiagonalUp = "LightDiagonalUp" | 表示浅对角线向上纹理。  | 
				
| lightGrid = "LightGrid" | 表示浅色水平交叉纹理。  | 
				
| lightHorizontal = "LightHorizontal" | 表示浅水平纹理。  | 
				
| lightTrellis = "LightTrellis" | 表示浅对角线交叉纹理。  | 
				
| lightVertical = "LightVertical" | 表示浅垂直纹理。  | 
				
| none = "None" | 表示没有纹理。  | 
				
| percent10 = "Percent10" | 表示 10% 的纹理。  | 
				
| percent12Pt5 = "Percent12Pt5" | 表示 12.5% 纹理。  | 
				
| percent15 = "Percent15" | 表示 15% 的纹理。  | 
				
| percent20 = "Percent20" | 表示 20% 的纹理。  | 
				
| percent25 = "Percent25" | 表示 25% 的纹理。  | 
				
| percent30 = "Percent30" | 表示 30% 的纹理。  | 
				
| percent35 = "Percent35" | 表示 35% 的纹理。  | 
				
| percent37Pt5 = "Percent37Pt5" | 表示 37.5% 纹理。  | 
				
| percent40 = "Percent40" | 表示 40% 的纹理。  | 
				
| percent45 = "Percent45" | 表示 45% 的纹理。  | 
				
| percent5 = "Percent5" | 表示 5% 的纹理。  | 
				
| percent50 = "Percent50" | 表示 50% 的纹理。  | 
				
| percent55 = "Percent55" | 表示 55% 的纹理。  | 
				
| percent60 = "Percent60" | 表示 60% 的纹理。  | 
				
| percent62Pt5 = "Percent62Pt5" | 表示 62.5% 的纹理。  | 
				
| percent65 = "Percent65" | 表示 65% 的纹理。  | 
				
| percent70 = "Percent70" | 表示 70% 的纹理。  | 
				
| percent75 = "Percent75" | 表示 75% 的纹理。  | 
				
| percent80 = "Percent80" | 表示 80% 的纹理。  | 
				
| percent85 = "Percent85" | 表示 85% 的纹理。  | 
				
| percent87Pt5 = "Percent87Pt5" | 表示 87.5% 的纹理。  | 
				
| percent90 = "Percent90" | 表示 90% 的纹理。  | 
				
| percent95 = "Percent95" | 表示 95% 的纹理。  | 
				
| solid = "Solid" | 表示纯色纹理。  |