S
sadsfan
I have written a macro that has created a custom save button. However after I
have used it once Word keeps on trying to save the document as a HTML web
page, rather than a word Document (doc). My code is below, does anyone know
what I might need to add to prevent this?
Sub New_Report()
'
'Save document and use result from "Name" form field as save filename
With Dialogs(wdDialogFileSaveAs)
.Name = ActiveDocument.FormFields("Text16").Result
.Show
End With
'Save old document and assign it to a variable
Dim ofile As Document
Set ofile = ActiveDocument
'Open a new document and close old
Documents.Add Template:=ActiveDocument.AttachedTemplate.FullName, _
DocumentType:=wdDocument, Visible:=True
ofile.Close
End Sub
have used it once Word keeps on trying to save the document as a HTML web
page, rather than a word Document (doc). My code is below, does anyone know
what I might need to add to prevent this?
Sub New_Report()
'
'Save document and use result from "Name" form field as save filename
With Dialogs(wdDialogFileSaveAs)
.Name = ActiveDocument.FormFields("Text16").Result
.Show
End With
'Save old document and assign it to a variable
Dim ofile As Document
Set ofile = ActiveDocument
'Open a new document and close old
Documents.Add Template:=ActiveDocument.AttachedTemplate.FullName, _
DocumentType:=wdDocument, Visible:=True
ofile.Close
End Sub