#1   Report Post  
PeterM
 
Posts: n/a
Default Macro Button

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!
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?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 :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Spell Check Macro to work Tom Hyland Microsoft Word Help 8 January 14th 05 06:45 PM
paste options button no longer visible Wendy Microsoft Word Help 3 January 8th 05 10:31 AM
How do I get the 'CreatepPDF' button on the Word 2003 display? acampbell Microsoft Word Help 3 January 6th 05 03:14 AM
Save As is not working due to macro security settings Craig Meritz Microsoft Word Help 1 December 16th 04 03:53 AM
macro help tzap_1998 Microsoft Word Help 2 December 11th 04 11:40 PM


All times are GMT +1. The time now is 02:15 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"