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
Jay Freedman - 03 Oct 2007 20:09 GMT
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")

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> 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
[quoted text clipped - 8 lines]
>
> Please help....Thanks Jack
Jean-Guy Marcil - 03 Oct 2007 20:10 GMT
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
[quoted text clipped - 8 lines]
>
> Please help....Thanks Jack
Try something like:
ActiveDocument.SaveAs FileName:="C:\Some Folder\SubFolder\" &
Format(Order, "00#") & "-" & Format(Now, "YY")

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jack_Feeman - 03 Oct 2007 20:26 GMT
Jay and Jean,
Thanks for the great response. I just couldn't get the syntax right and
working...
Thanks again
Jack
> Jack_Feeman was telling us:
> Jack_Feeman nous racontait que :
[quoted text clipped - 16 lines]
> ActiveDocument.SaveAs FileName:="C:\Some Folder\SubFolder\" &
> Format(Order, "00#") & "-" & Format(Now, "YY")