![]() |
|
|
|
#1
|
|||
|
|||
|
Yes, it is possible, but not easy. I would do this by putting an AutoNew in your macro-enabled template that changes the File Open directory (which is the default File Save directory).
The following macro will change the file save path and force an immediate save when a new document is created based on the template that contains the macro. Code:
Sub AutoNew()
'
Dim strNewPath As String
strNewPath = "C:\desired location\" ' Set save location
ChangeFileOpenDirectory strNewPath
ActiveDocument.Save
End Sub
Users will need to have macros trusted in the template location. Note that this will temporarily set the place for File>Open if they try opening another document, just as it would if they were to manually save the file in that directory. |
|
#2
|
|||
|
|||
|
Hi Charles, sorry to be a noob, but how exactly do I add that macro to a template? Can't seem to find the macro option
.Thanks, Ryan |
|
#3
|
|||
|
|||
|
Ok I've figured out how to save the macro into the document and how to save the template as a macro enabled template. Though it asks if I wish to enable content for macros, can I set it so that it's a trusted document and macro's in it are always avaliable?
It seems I have to manually run it, isit possible to have it so that whenI click the 'save' icon that it will run the macro and the correct directory will be displayed for saving into. Or maybe as an alternate, when I press CRTL+S? Thanks, Ryan. |
|
#4
|
|||
|
|||
|
Quote:
You should not have to run it manually. Because it is named AutoNew should run automatically when the new document is created based on the template. You can set it up to intercept the Save Command or the Ctrl-S shortcut. You would do the latter by customizing your keyboard shortcut (and storing that shortcut in your template). If you name your macro FileSave that should intercept the save command. But, see http://word.mvps.org/FAQs/MacrosVBA/...tSavePrint.htm |
|
#5
|
|||
|
|||
|
Woops, that's my problem I changed autonew to name the macro... Thought it was a naming process lol. Will have a go when I get a spare moment and spread some love if it works
Ryan |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi location templates | James m | Outlook | 0 | 05-23-2012 06:53 PM |
Word 2010 save to new location
|
youngdave55 | Word | 5 | 05-10-2012 12:12 AM |
Tabs in MS Word 2010 templates
|
ibsfsg | Word | 2 | 12-15-2011 04:54 AM |
Creating templates for dummies in Word 2010
|
oceanclub | Word | 1 | 07-14-2011 08:39 PM |
| Promt for save location when sendimg mail | blegs38552 | Outlook | 0 | 01-31-2010 07:29 AM |