Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / May 2004

Tip: Looking for answers? Try searching our database.

Set data source pathname automatically to same folder as doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Serena - 05 May 2004 04:11 GMT
H

I have an existing Word 97 document which uses an Access 97 database as its source.  The document is called (via a Call Shell command) from Access code on a form and then the code in the Word merging macro uses a hard-coded ChangeFileOpenDirectory command to set the directory for saving the merged document

I would like to change this code so that, regardless of which directory the document and database reside in, the Word macro can pick up the current directory of the document, and look for its datasource and save the merged file in the same directory

Thanks
Cindy M  -WordMVP- - 06 May 2004 10:32 GMT
Hi =?Utf-8?B?U2VyZW5h?=,

> I have an existing Word 97 document which uses an Access 97 database as its source.  The document is called (via a Call Shell command) from Access code on a form and then the code in the Word merging macro uses a hard-coded ChangeFileOpenDirectory command to set the directory for saving the merged document.
>  
> I would like to change this code so that, regardless of which directory the document and database reside in, the Word macro can pick up the current directory of the document, and look for its datasource and save the merged file in the same directory.

   ActiveDocument.Path

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :-)
Serena - 10 May 2004 21:28 GMT
Thanks for your assistance, that has worked nicely.

>-----Original Message-----
>Hi =?Utf-8?B?U2VyZW5h?=,
>
>> I have an existing Word 97 document which uses an Access 97 database as its source.  The document is called
(via a Call Shell command) from Access code on a form and
then the code in the Word merging macro uses a hard-coded
ChangeFileOpenDirectory command to set the directory for
saving the merged document.
>>  
>> I would like to change this code so that, regardless of which directory the document and database reside in, the
Word macro can pick up the current directory of the
document, and look for its datasource and save the merged
file in the same directory.

>    ActiveDocument.Path
>
[quoted text clipped - 4 lines]
>
>This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-
mail :-)

>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.