简体   繁体   English

将母版幻灯片应用于多个幻灯片

[英]Apply master slide to multiple powerpoints

I'm quite new to this.我对此很陌生。 I have a bunch of powerpoint presentations that I would like to apply a master slide to.我有一堆想应用母版幻灯片的 PowerPoint 演示文稿。 All the powerpoints are within subfolders of one folder (if that makes sense)所有powerpoints都在一个文件夹的子文件夹中(如果有意义的话)

So if anyone can help with the code it would be greatly appreciated.因此,如果有人可以帮助编写代码,将不胜感激。 the code should:代码应该:

  1. Open FileDialog So I can choose the folder (Ihave the code below)打开 FileDialog 所以我可以选择文件夹(我有下面的代码)

     Sub ShowFileDialog() Dim dlgOpen As FileDialog Set dlgOpen = Application.FileDialog(Type:=msoFileDialogOpen) With dlgOpen .AllowMultiSelect = True .Show End With End Sub
  2. Scan for powerpoints in the folder and for every ppt:扫描文件夹中的powerpoints和每个ppt:

    • Delete current master template (include remove links)删除当前主模板(包括删除链接)

    • Apply the new master template应用新的主模板

    • save & close保存并关闭

Hope that makes sense.希望这是有道理的。 The current master template is saved as a file called "slidemaster".当前母版模板保存为名为“slidemaster”的文件。 I am using MS powerpoint 2010.我正在使用 MS powerpoint 2010。

Not sure what you mean by "remove links" but to apply a different template, you'd open a presentation, then:不确定“删除链接”是什么意思,但要应用不同的模板,您需要打开一个演示文稿,然后:

ActivePresentation.ApplyTemplate sTemplate

where sTemplate = the full path to the POTX file containing your template.其中 sTemplate = 包含模板的 POTX 文件的完整路径。

This page on my PPTFAQ site explains how to do something to every file in a folder that matches a filespec:我的 PPTFAQ 站点上的这个页面解释了如何对与文件规范匹配的文件夹中的每个文件执行某些操作:

Batch: Do something to every file in a folder http://www.pptfaq.com/FAQ00536_Batch-_Do_something_to_every_file_in_a_folder.htm批处理:对文件夹中的每个文件进行处理http://www.pptfaq.com/FAQ00536_Batch-_Do_something_to_every_file_in_a_folder.htm

In this case, "something" would be running the line of code above then saving the file.在这种情况下,“某事”将运行上面的代码行,然后保存文件。

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

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