Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Specify path during an autosave event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack_Feeman - 03 Oct 2007 19:49 GMT
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")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.