Set data source pathname automatically to same folder as doc

S

Serena

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
 
C

Cindy M -WordMVP-

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 :)
 
S

Serena

Thanks for your assistance, that has worked nicely.
-----Original Message-----
Hi =?Utf-8?B?U2VyZW5h?=,
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.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 :)
 

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