File location

T

Tony

How to I determine the name of the file path to the file with the macro
that's running ? Word 97.

Thanks, for any help,

Tony
 
S

Shauna Kelly

Hi Tony

ThisDocument.Path will return the path to the document (or template or
add-in) that holds the code that's running.


That works in Word 2000 and above. I don't have a copy of Word 97 here to
check, but I think it worked then too.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
J

Jonathan West

Shauna Kelly said:
Hi Tony

ThisDocument.Path will return the path to the document (or template or
add-in) that holds the code that's running.


That works in Word 2000 and above. I don't have a copy of Word 97 here to
check, but I think it worked then too.


Application.MacroContainer.Path also works.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top