【发布时间】:2014-01-30 00:50:15
【问题描述】:
我创建了以下宏来打开某个地图中的所有ppt文件
Sub openAllPPT()
Dim strCurrentFile As String
Dim strFileSpec As String
strFileSpec = "C:\Documents and Settings\aa471714\Desktop\Nieuwe map*.ppt"
strCurrentFile = Dir$(strFileSpec)
While Len(strCurrentFile) > 0
Presentations.Open (strCurrentFile)
strCurrentFile = Dir$
Wend
End Sub
当我运行它时,我确实看到任何东西打开了。有人知道我错过了什么吗?
【问题讨论】:
-
试试
Presentations.Open FileName:=strCurrentFile, WithWindow:=True -
确定循环输入了吗?尝试将路径添加到文件,因为 strCurrentFile 是文件名无路径
-
你的代码已经过时了。尝试使用 FileSystemObject。另外,将 While..Wend 替换为 Do While..Loop
标签: vba powerpoint