【发布时间】:2012-01-23 14:55:50
【问题描述】:
有没有一种方法可以在 PowerPoint VSTO 中创建样式来格式化文本,类似于 Word 文档可以做到的:
// document is of type Microsoft.Office.Interop.Word.Document
Style sectionHeadingExt = document.Styles.Add("myStyle");
sectionHeadingExt.set_BaseStyle(SectionHeadingInt);
sectionHeadingExt.Font.Size = 14;
sectionHeadingExt.Font.Color = WdColor.wdColorBlack;
sectionHeadingExt.Font.Bold = (int)MsoTriState.msoFalse;
sectionHeadingExt.ParagraphFormat.LineSpacingRule = WdLineSpacing.wdLineSpaceMultiple;
sectionHeadingExt.ParagraphFormat.LineSpacing = _application.LinesToPoints((float)1.11);
sectionHeadingExt.ParagraphFormat.SpaceBefore = 0;
sectionHeadingExt.ParagraphFormat.SpaceAfter = 0;
我需要创建一个自定义功能区选项卡,在其中添加一个按钮,当单击该按钮时,我需要相应地设置所选段落的格式:
GetCurrentParagraph().set_Style("myStyle");
我在 Word AddIn 中执行了此操作,但在 PowerPoint 中可以吗?此外,我在 PowerPoint 中看不到 样式/更改样式 选项(在 Word 中它们出现在“主页”选项卡上)。
【问题讨论】:
标签: vsto powerpoint