Vba 以编程方式从演示文稿中删除演讲者笔记
我有很多演讲需要在公司外分享,我需要一种方法来循环浏览所有演讲者的笔记并自动删除它们。在VBA中是否有这样做的方法?我已对此进行了搜索,但似乎找不到任何内容。编写了一个脚本,用于从目录中的所有PowerPoint文件中删除演讲者笔记。你应该能够调整它以适应你的需要Vba 以编程方式从演示文稿中删除演讲者笔记,vba,powerpoint,Vba,Powerpoint,我有很多演讲需要在公司外分享,我需要一种方法来循环浏览所有演讲者的笔记并自动删除它们。在VBA中是否有这样做的方法?我已对此进行了搜索,但似乎找不到任何内容。编写了一个脚本,用于从目录中的所有PowerPoint文件中删除演讲者笔记。你应该能够调整它以适应你的需要 Sub RemoveSpeakerNotes() Set objPPT = CreateObject("PowerPoint.Application") objPPT.Visible = True st
Sub RemoveSpeakerNotes()
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='E:\DirectoryContainingPresentations'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In FileList
If objFile.Extension = "pptx" Or objFile.Extension = "ppt" Then
Set objPresentation = objPPT.Presentations.Open(objFile.Name)
Set colSlides = objPresentation.Slides
On Error Resume Next
For Each objSlide In colSlides
objSlide.NotesPage.Shapes(2).TextFrame.TextRange = ""
Next
objPresentation.Save
objPresentation.Close
End If
Next
MsgBox ("Done")
End Sub
那太完美了,正是我需要的!哦,很抱歉。我就这么做了。再次感谢!