I have a word document with some vba code. I want to return the path of the directory in which the word document is saved.
This is the code I used:
Dim PathCurrentDocument As Variant
PathCurrentDocument = ActiveDocument.path
Debug.Print PathCurrentDocument
The desired output is:
"C:\Users\firstname.lastname\OneDrive - company name\VBA\4_update_documents_with_vba_inside_word\document_templates_to_modify"
What I am getting, is the web link, which looks like this:
https://my-company.sharepoint.com/personal/my_name/Documents/VBA/4_update_documents_with_vba_inside_word/Document_A_Template_with_macro.docm
The microsoft documentation only says the property returns the disk or web path to the document. It does not say how to choose which one to return.