changing path in word application?

E

eric

Hi!

I use a word application to open up word and a document. Works fine but I
would like word to automatically save into a default folder (and not the
same folder I open the document from). Something like ChDir thrugh
automation. Any ideas?

Thx!

/e
 
O

old man

When you save a previously opened document it is saved (by default) to the
path and with the name it had when it was opened. VBA gives you acccess to
the doc name in the properties:

activedocument.name
and
activedocument.fullname (both readonly).

You can save a document to a different location by:

ActiveDocument.SaveAs FileName:="C:\TEST2\cmda2b.doc"

where the document (regardless of where it was when it was opened and what
it was named) will be saved to the folder "c:\testw" with the name
"cmda2b.doc."

To change the location of where new documents are saved to and where Word
looks if you click on File --> Open

Options.DefaultFilePath(Path:=wdDocumentsPath) ="c:\newlocation\"

old man
 

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