VBA Powerpoint. How to get the current directory path to a string in VBA?

VBA Powerpoint. How can I set the current environment directory?

I also tried this code:

Sub test()
Dim sPath As String
sPath = ActiveWorkbook.Path
MsgBox sPath
End Sub

But it is said: Object required

Please help me make it work ...

+5
source share
1 answer

Tim provided the answer. You can use something like:

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
+9
source

All Articles