简体   繁体   English

custClr PowerPoint 演示文稿列表

[英]custClrList of PowerPoint presentation

I'm using Microsoft.Office.Interop.PowerPoint library to work with PowerPoint presentations and looking for a way to programmatically modify 'Custom Colors' section of color palette.我正在使用 Microsoft.Office.Interop.PowerPoint 库来处理 PowerPoint 演示文稿,并寻找一种以编程方式修改调色板的“自定义颜色”部分的方法。 I can see that it's stored inside 'custClrList' tag in ppt->theme files and can be modified manually, but not sure how to access it from the code.我可以看到它存储在 ppt->theme 文件中的“custClrList”标签内,可以手动修改,但不知道如何从代码中访问它。

In PowerPoint custom colors are saved to the XML file, so if you want to re-use it on another machines you need to think including such files to the installer.在 PowerPoint 中自定义 colors 被保存到 XML 文件中,所以如果你想在另一台机器上重新使用它,你需要考虑将这些文件包含到安装程序中。 For example, here is a VBA sample which creates a custom theme and saves it to a file:例如,这是一个 VBA 示例,它创建了一个自定义主题并将其保存到一个文件中:

Sub mkThemeCols()
With ActivePresentation.SlideMaster.Theme
.ThemeColorScheme(msoThemeAccent1) = RGB(255, 0, 0)
.ThemeColorScheme(msoThemeAccent2) = RGB(0, 255, 0)
.ThemeColorScheme(msoThemeAccent3) = RGB(0, 255, 255)
.ThemeColorScheme(msoThemeAccent4) = RGB(255, 255, 0)
.ThemeColorScheme(msoThemeAccent5) = RGB(23, 255, 10)
.ThemeColorScheme(msoThemeAccent6) = RGB(23, 255, 100)
.ThemeColorScheme(msoThemeDark1) = RGB(23, 0, 0)
.ThemeColorScheme(msoThemeDark2) = RGB(23, 23, 23)
.ThemeColorScheme.Save Environ("APPDATA") & "\Microsoft\Templates\Document Themes\Theme Colors\myNew Theme.xml"
End With
End Sub

It is also possible to add XML so that there are extra color schemes that travel with the presentation (method on Echo Swinford's site )也可以添加 XML 以便在演示文稿中使用额外的配色方案( Echo Swinford 网站上的方法)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM