我尝试打开,更改并保存演示文稿,但它始终以只读方式打开:
If measTypesDict.Exists(MeasType) = False Then
Dim targetPath As String
Dim newPres As PowerPoint.presentation
measTypesDict.Add MeasType, New Dictionary
Set newPres = PowerPoint.Application.Presentations.Add(msoFalse)
targetPath = rootDir & "\final\" & MeasType & ".ppt"
newPres.SaveAs targetPath
' newPres.Close that is what's been missing
targetPresentationsDict.Add MeasType, Presentations.Open(targetPath, ReadOnly:=msoFalse, WithWindow:=msoFalse)
End If
The ReadOnly parameter is used to open a presentation as Read-Only.
The following example opens a file named test.ppt as Read-Only.
Sub OpenPresentationReadOnly()
Presentations.Open "c:\test.ppt", msoTrue
End Sub
任何人都可以给我一个提示,为什么会这样?我是目标文件夹的所有者,我根据文件夹设置完全控制。
答案 0 :(得分:-1)
你可以试试这个:
Sub OpenPresentation()
Presentations.Open "c:\test.ppt"
End Sub
希望它有所帮助。