GetEffective
TextStyle.GetEffective 方法
获取应用继承的有效文本样式格式数据。
public ITextStyleEffectiveData GetEffective()
返回值
示例
此示例演示了如何获取一些有效的文本样式属性。
[C#]
using (Presentation pres = new Presentation(@"MyPresentation.pptx"))
{
IAutoShape shape = pres.Slides[0].Shapes[0] as IAutoShape;
ITextStyleEffectiveData effectiveTextStyle = shape.TextFrame.TextFrameFormat.TextStyle.GetEffective();
for (int i = 0; i <= 8; i++)
{
IParagraphFormatEffectiveData effectiveStyleLevel = effectiveTextStyle.GetLevel(i);
Console.WriteLine("= 第 #" + i + " 层样式的有效段落格式 =");
Console.WriteLine("深度: " + effectiveStyleLevel.Depth);
Console.WriteLine("缩进: " + effectiveStyleLevel.Indent);
Console.WriteLine("对齐: " + effectiveStyleLevel.Alignment);
Console.WriteLine("字体对齐: " + effectiveStyleLevel.FontAlignment);
}
}