通过下面的代码,你可以将幻灯片里面的某一页保存成为一个演示文稿文件,注意,在VBA环境下使用如下的代码。
Dim myPpt As PowerPoint.Application
Dim myPre As PowerPoint.Presentation
Set myPpt = CreateObject("PowerPoint.Application")
myPpt.Visible = msoTrue
Set myPre = myPpt.Presentations.Open(FileName:="演示文稿名称.ppt", withwindow:=msoFalse)
myPpt.DisplayAlerts = ppAlertsNone
myPre.Slides(13).Export "D:\MyPowerpoint", "PPT" '假设单独保存第13页
myPre.Close Set myPre = myPpt.Presentations.Open(FileName:="D:\MyPowerpoint.ppt", withwindow:=msoTrue)
myPre.SlideShowSettings.Run
MsgBox "这里是提示信息,请自行填写" '如果有别的PPT还在打开并编辑的话,这里要先关myPre,再打开报警
myPre.Close
myPpt.DisplayAlerts = ppAlertsAll
myPpt.Quit
set myPre = nothing
set myPpt = nothing