Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current Word document's save directory

Tags:

ms-word

save

vba

I have a Word document that is already saved and I need to get its existing save directory and/or full file path (i.e. C:\Users\Public\Documents\testDoc.docx).

How can this be acquired from a macro/VBA?

like image 536
ikathegreat Avatar asked Dec 02 '22 22:12

ikathegreat


1 Answers

ActiveDocument.FullName

The above gives the full path to the document, including the file name.

ActiveDocument.Path

The above gives the directory where your document is saved.

ActiveDocument.Name

The above gives the name of the document, without path information.

like image 111
shahkalpesh Avatar answered Dec 22 '22 22:12

shahkalpesh