Help with autoexec

C

caj

I have a template that is saved on a sharepoint site and used by many
different people. Problem is when people open the template and add text, then
go to save, they inadvertently save the file as a .dot file.

I have a AutoNew macro that would force the file to be saved as a .doc. This
works if the file is opened directly from a directory, but it does not work
when opened from where it is a link on the sharepoint internet site.

Is there another way to force the file to save as a .doc? Or is there a
better way to do this? Below is the code for the AutoNew macro:

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

Graham Mayor

Why are they 'opening' the template at all? They should be creating new
documents from the template, then the issue shouldn't arise.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

caj

The file .dot opens as a read_only .dot file when opened from the site . They
are creating new documents but when they go to save the file it ends up being
saved as a .dot and not doc.
 
C

caj

I created this but it causes Word to crash when run. Can you help with this:

Public Sub FileSave()
Dim sFolder As String
Dim oDialog As Dialog

sFolder = Options.DefaultFilePath(wdCurrentFolderPath)
'Change the next line to your requirements
ChangeFileOpenDirectory "C:\"

Set oDialog = Dialogs(wdDialogFileSaveAs)
With oDialog
..Format = wdFormatDocument
..Show
End With

ChangeFileOpenDirectory sFolder
ActiveWindow.Caption = ActiveDocument.FullName

End Sub
 

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