Macro Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a word doc that I'm using as a template with MS Access. I've build a
macro in the word doc that locates a specific line of text, positions down
one line and then inserts an excel spreadsheet into it. The directory where
the excel spreadsheet exists varries from user to user. I need a way to
dynamically set the path to the excel spreadsheet via VBA in a word macro.
In MS Access I can use CURRENTPROJECT.PATH to get a system variable for the
current project path. Is there a similar VBA variable in Word?

Thanks in advance for your help!
 
Hi =?Utf-8?B?UGV0ZXJN?=,
I have a word doc that I'm using as a template with MS Access. I've build a
macro in the word doc that locates a specific line of text, positions down
one line and then inserts an excel spreadsheet into it. The directory where
the excel spreadsheet exists varries from user to user. I need a way to
dynamically set the path to the excel spreadsheet via VBA in a word macro.
In MS Access I can use CURRENTPROJECT.PATH to get a system variable for the
current project path. Is there a similar VBA variable in Word?
Best place to get a quick answer to a VBA question is one of the word.vba
newsgroups...

Yes, Word does have equivalents. I'm not 100% clear on what you mean by
"project": whether you mean the document, itself, or a template. Assuming the
document, this will work:
ActiveDocument.Path

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Back
Top