VBA To set folder in MSWord

K

Karen Hart

I have a field in each record that contains the path for saving msword
docs called txtPathForWordDocs. I have a command button that runs a
vba procedure that assembles a document in MSWord and leaves the user
in MSWord with the document on screen. When and if the user chooses to
save that document, I would like MSWord to save the doc to the folder
referenced in txtPathForWordDocs.

How can I pass the info in txtPathForWordDocs and therefore and set
the directory for saving to MSWord ?

THank you!
 
G

Gloops

Karen Hart wrote, on 06th March 2012 21:24 UTC + 1 :
...
How can I pass the info in txtPathForWordDocs and therefore and set
the directory for saving to MSWord ?

THank you!

Hello,

I presume you mean using the Document.SaveAs command ?

I was wondering whether you were thinking about displaying a dialog box
to choose the folder ...
I have to admit I did not find "folder" in the list of standard dialog
boxes of Word. A few weeks ago I saw a Microsoft page that explained how
to use the file selection dialog box to select a folder, I admit I did
not realize the use of it at that moment.

Otherwise you can take inspiration of this :
http://allapi.mentalis.org/apilist/SHBrowseForFolder.shtml
 

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