VBA Powerpoint。如何设置环境当前目录?
我也试过这段代码:
Sub test()
Dim sPath As String
sPath = ActiveWorkbook.Path
MsgBox sPath
End Sub
但是说:Object required
请帮助我让它发挥作用......
答案 0 :(得分:10)
Sub test()
Dim sPath As String
sPath = ActivePresentation.Path
If Len(sPath) > 0 Then
MsgBox ActivePresentation.Name & vbNewLine & "saved under" & vbNewLine & sPath
Else
MsgBox "File not saved"
End If
End Sub