I need a Save (or SaveAs) macro

C

caj

Can anyone help (ASAP)!! I created a Word template that is going to be used
by many different people (some of which are not very familiar with Word). The
template will be stored on the internet and when downloaded and saved does
not save the file as a doc. What i need is a macro that on the first time the
document is saved, it saves the file to that person's MyDocuments folder?

Desperate in need of help.
 
P

Peter A

Can anyone help (ASAP)!! I created a Word template that is going to be used
by many different people (some of which are not very familiar with Word). The
template will be stored on the internet and when downloaded and saved does
not save the file as a doc. What i need is a macro that on the first time the
document is saved, it saves the file to that person's MyDocuments folder?

Desperate in need of help.

Documents are by default saved to My Documents. The location of the
template has nothing to do with it.
 
C

caj

That is generally correct, but it is not working that way when I save the
file to intrenal sharepoint server. It tries to save the file back to the
server.
 
C

caj

The macro would be inserted into the template (.dot) as the template may or
may not be saved to the person's individual template folder.
 
G

Graham Mayor

The following macro saved in the document template will change the file save
path to the user's documents path and prompt to save the document whenever a
new document is created from that template:

Sun AutoNew()
Dim sPath As String
sPath = Options.DefaultFilePath(Path:=wdDocumentsPath)
ChangeFileOpenDirectory "sPath"
ActiveDocument.Save
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

Oops! Correcting the typo 'Sun' to 'Sub' might help? :blush:( but the real
problem is the quotes around sPath

Change to

Sub AutoNew()
Dim sPath As String
sPath = Options.DefaultFilePath(Path:=wdDocumentsPath)
ChangeFileOpenDirectory sPath
On Error GoTo Cancelled
ActiveDocument.Save
Exit Sub
Cancelled:
If Err.Number = 4198 Then
MsgBox "User Cancelled"
End If
End Sub

Apologies :(
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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

Top