File location by template?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was hoping to be able to save files in a particular location according to
which template I use. For example, if I use the letter template, the
document would default to a letters folder. If I use a lecture template, the
document would default to a lectures folder. I was hoping to be abl eto save
these preferences by template, but it seems to make the change globally. Am
I out of luck?
 
I was hoping to be able to save files in a particular location according to
which template I use. For example, if I use the letter template, the
document would default to a letters folder. If I use a lecture template, the
document would default to a lectures folder. I was hoping to be abl eto save
these preferences by template, but it seems to make the change globally. Am
I out of luck?

In each template, place two macros (using the instructions at
http://www.gmayor.com/installing_macro.htm) that look like this,
except that each template contains a different path:

Public Sub FileSaveAs()
With Dialogs(wdDialogFileSaveAs)
.Name = "c:\documents\letters\"
.Show
End With
End Sub

Public Sub FileSave()
If ActiveDocument.Path = "" Then
With Dialogs(wdDialogFileSaveAs)
.Name = "c:\documents\letters\"
.Show
End With
Else
ActiveDocument.Save
End If
End Sub

It's important to end the path with a backslash. These macros will run
when you use the File > Save As menu item and the File > Save menu
item, respectively.

There's more about this at
http://www.word.mvps.org/FAQs/MacrosVBA/ChangeSaveAsPath.htm.
 
Thank you. I haven't done much with macros, but it looks like this should
help.
 
When I used those macros to save in specified files, I get an error message
of Compile Error: Ambiguous name detected FileSaveAs and I have no idea
what's the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top