I know how to do this in EXCEL but not sure how to do it in Word. Automatically save to a specific drive without a user prompt. Thanks to anyone that can help.
I know how to do this in EXCEL but not sure how to do it in Word. Automatically save to a specific drive without a user prompt. Thanks to anyone that can help.
Peace of mind is found in some of the strangest places.
You need to make a Class Module to get the Before Save Event in Word. I outlined an example in This Thread. Take a look and see if that helps you or not.
You can probably do it more simply than that by intercepting the Word commands, but can you give a bit more detail about what you mean by automatically? Automatically when? Do you want to override normal saving, or automatically save on exit, or something else?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Just want to somehow save the file so the user has to do nothing except click save. I want the path to be defined internally. Each day the file will be saved to a folder where it will be archived. I need to find a way to have it saved for example report01012005, report01022005 etc. I would like to have it save it by adding 1 to the day and 1 to the month if that month is ended.
Peace of mind is found in some of the strangest places.
If you create a routine called FileSave (in a standard module in the document or its template - it might depend a bit how the document is being created) it will be run instead of the built in Save command and you can do what you want in the routine, for example ..
[VBA]Sub FileSave()
ActiveDocument.SaveAs "report" & Format(DateAdd("d", 1, Date), "mmddyyyy")
End Sub[/VBA]
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Hi,
Intercepting Word Commands is the way to go.
Tony's Sub runs when a user presses the "Save" button..however a lot off people do use the "SaveAs" button in the "File" menu so add this procedure as well: [VBA]Sub FileSaveAs()
ActiveDocument.SaveAs "report" & Format(DateAdd("d", 1, Date), "mmddyyyy")
End Sub
[/VBA]
Enjoy!
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)