Specify path during an autosave event

J

Jack_Feeman

I have the following code in a Word 2003 template to incrementally name a new
document created from the template and then save it with that name.

ActiveDocument.SaveAs FileName:=Format(Order, "00#") & "-" & Format(Now, "YY")

Works great except it saves the document to My Documents directory
automatically. I want to specify the path that the code will automatically
save it to.

Please help....Thanks Jack
 
J

Jay Freedman

Since all you've given it is the filename, Word uses its default save path,
which is My Documents. To put it anywhere else, attach the filename to the
end of the path you want:

ActiveDocument.SaveAs FileName:="C:\Somewhere Else\" & _
Format(Order, "00#") & "-" & Format(Now, "YY")

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jean-Guy Marcil

Jack_Feeman was telling us:
Jack_Feeman nous racontait que :
I have the following code in a Word 2003 template to incrementally
name a new document created from the template and then save it with
that name.

ActiveDocument.SaveAs FileName:=Format(Order, "00#") & "-" &
Format(Now, "YY")

Works great except it saves the document to My Documents directory
automatically. I want to specify the path that the code will
automatically save it to.

Please help....Thanks Jack

Try something like:

ActiveDocument.SaveAs FileName:="C:\Some Folder\SubFolder\" &
Format(Order, "00#") & "-" & Format(Now, "YY")



--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jack_Feeman

Jay and Jean,
Thanks for the great response. I just couldn't get the syntax right and
working...
Thanks again
Jack
 

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