Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2012, 11:03 AM
Charles Kenyon Charles Kenyon is offline Word 2010 - Different Save Location for Different Templates? Windows Vista Word 2010 - Different Save Location for Different Templates? Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,595
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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
You would set the actual path in the line setting the value for strNewPath. Note that the path has to end with a backslash \



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.
Reply With Quote
  #2  
Old 05-24-2012, 11:07 PM
RDKells RDKells is offline Word 2010 - Different Save Location for Different Templates? Windows 7 32bit Word 2010 - Different Save Location for Different Templates? Office 2010 32bit
Novice
Word 2010 - Different Save Location for Different Templates?
 
Join Date: May 2012
Posts: 6
RDKells is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 05-25-2012, 03:12 AM
RDKells RDKells is offline Word 2010 - Different Save Location for Different Templates? Windows 7 32bit Word 2010 - Different Save Location for Different Templates? Office 2010 32bit
Novice
Word 2010 - Different Save Location for Different Templates?
 
Join Date: May 2012
Posts: 6
RDKells is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 05-25-2012, 05:14 AM
Charles Kenyon Charles Kenyon is offline Word 2010 - Different Save Location for Different Templates? Windows Vista Word 2010 - Different Save Location for Different Templates? Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,595
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by RDKells View Post
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.
Trusted locations are set by each user. You tell Word which are the folders where you trust macros. A very good place to mark as a trusted location is the folder you designate to hold workgroup templates.

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
Reply With Quote
  #5  
Old 05-25-2012, 08:07 AM
RDKells RDKells is offline Word 2010 - Different Save Location for Different Templates? Windows 7 32bit Word 2010 - Different Save Location for Different Templates? Office 2010 32bit
Novice
Word 2010 - Different Save Location for Different Templates?
 
Join Date: May 2012
Posts: 6
RDKells is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi location templates James m Outlook 0 05-23-2012 06:53 PM
Word 2010 - Different Save Location for Different Templates? Word 2010 save to new location youngdave55 Word 5 05-10-2012 12:12 AM
Word 2010 - Different Save Location for Different Templates? Tabs in MS Word 2010 templates ibsfsg Word 2 12-15-2011 04:54 AM
Word 2010 - Different Save Location for Different Templates? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft