如何使用VBA或Apple脚本从幻灯片演示文稿中分割幻灯片

时间:2018-06-13 14:44:45

标签: vba macos applescript powerpoint

如何使用VBA或Apple脚本从演示文稿中分割幻灯片。以前我使用VBA代码实现相同但在powerpoint 16.13.1我收到错误,因为“Mac PPT不支持在少窗口模式下打开文件。”它正在使用以前版本的PowerPoint。

Sub SaveSlide(lSlideNum As Long, sFileName As String)

Dim oTempPres As Presentation
Dim x As Long

ActivePresentation.SaveCopyAs sFileName
' open the saved copy windowlessly
Set oTempPres = Presentations.Open(sFileName, , , False)

For x = 1 To lSlideNum - 1
    oTempPres.Slides(1).Delete
Next

' What was slide number lSlideNum is now slide 1
For x = oTempPres.Slides.Count To 2 Step -1
    oTempPres.Slides(x).Delete
Next

oTempPres.Save
oTempPres.Close
End Sub

在上面的代码中,我在这一行中收到错误

Set oTempPres = Presentations.Open(sFileName, , , False)

请帮帮我。 this is the error which I am getting

0 个答案:

没有答案