M
Michael Sundermann
Hi,
Excel and PowerPoint have a SaveCopyAs method
(Workbook/Presentation).
Word does not have such a function.
Does anyone know how so simulate such a function in Word ?
My best idea is the code below.
The below code compares the memory image of the active document
with the file it is associated with.
The compare results are placed in a new file.
Any changes in the resulting new file are accepted
and the results written to the temp file.
Thanks
Michael
Public Sub Test()
Dim TempName As String
Dim OrigName As String
TempName = "C:\temp\" & ActiveDocument.Name
OrigName = ActiveDocument.FullName
ActiveDocument.Compare
Name:=OrigName, CompareTarget:=wdCompareTargetNew
'the new document is now active
If ActiveDocument.Revisions.Count >= 1 Then _
ActiveDocument.Revisions.AcceptAll
ActiveDocument.SaveAs FileName:=TempName
ActiveDocument.Close
End Sub
Excel and PowerPoint have a SaveCopyAs method
(Workbook/Presentation).
Word does not have such a function.
Does anyone know how so simulate such a function in Word ?
My best idea is the code below.
The below code compares the memory image of the active document
with the file it is associated with.
The compare results are placed in a new file.
Any changes in the resulting new file are accepted
and the results written to the temp file.
Thanks
Michael
Public Sub Test()
Dim TempName As String
Dim OrigName As String
TempName = "C:\temp\" & ActiveDocument.Name
OrigName = ActiveDocument.FullName
ActiveDocument.Compare
Name:=OrigName, CompareTarget:=wdCompareTargetNew
'the new document is now active
If ActiveDocument.Revisions.Count >= 1 Then _
ActiveDocument.Revisions.AcceptAll
ActiveDocument.SaveAs FileName:=TempName
ActiveDocument.Close
End Sub