我只想用C#更新Powerpoint中的字符间距,但我不知道该怎么做。我迭代Slides
和Shapes
,但我找不到Spacing
中的Font
属性,如Word。
int slideCount = pprst.Slides.Count;
for (int s = 1; s <= slideCount; ++s )
{
MSPPT.Slide slide = pprst.Slides[s];
int shapeCount = slide.Shapes.Count;
for (int h = 1; h <= shapeCount; ++h)
{
MSPPT.Shape shape = slide.Shapes[h];
MSPPT.TextRange textRange = shape.TextFrame.TextRange;
}
}
如果有人需要,只需将代码粘贴到此处。
MSPPT.Slide slide = pprst.Slides[s];
int shapeCount = slide.Shapes.Count;
for (int h = 1; h <= shapeCount; ++h)
{
MSPPT.Shape shape = slide.Shapes[h];
if (shape.HasTextFrame == MsoTriState.msoTrue)
{
if (shape.TextFrame2.HasText == MsoTriState.msoTrue)
{
shape.TextFrame2.TextRange.Font.Spacing = 0;
}
else
{
continue;
}
}
else
{
continue;
}
}