Word SaveCopyAs

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 thecode 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
 

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