【发布时间】:2017-07-13 04:14:55
【问题描述】:
我需要通过 VBA 代码将演示文稿的配色方案更改为 Office 2007-2010。我该怎么做?
我尝试了类似下面的方法,但似乎不起作用。
ActivePresentation.ColorSchemes.Add
ActivePresentation.ColorSchemes(1).Colors(ppAccent1).RGB = RGB(0, 0, 1)
ActivePresentation.ColorSchemes(1).Colors(ppAccent1).RGB = RGB(0, 0, 2)
【问题讨论】:
-
如果主题颜色被导出到 .xml 文件,您可以简单地将演示文稿 SlideMaster 设置(加载)到它:
ActivePresentation.SlideMaster.Theme.ThemeColorScheme.Load "C:\Theme Colors\Office 2007 - 2010.xml"更改存储路径xml 文件。 -
你应该可以在
%USERPROFILE%\AppData\Roaming\Microsoft\Templates\Document Themes\Theme Colors找到自定义颜色xml文件。 -
该问题已在下面得到解答,但值得指出的是,ColorSchemes 仅用于向后兼容 2007 年之前的 PPT 版本。对于 PPT 2007 及以后的版本,您需要使用 ColorThemes。
标签: vba powerpoint