Edit: I figured out an answer to this question after a burst of inspiration.
My aim was to make a macro that duplicates a document, runs some editing macros on the new copy, then compares the original file with the new file. I'm doing it this way because having Track Changes on causes problems for the editing macros.
The working code is:
Code:
Sub Save_Then_Compare()
'Set original document as oDoc
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
'Save original document
ActiveDocument.Save
'Select all text and paste into a new document
ActiveDocument.Range.Select
ActiveDocument.Range.Copy
Documents.Add
Selection.Paste
'Save as docx under a new filename
ActiveDocument.SaveAs2 Filename:="Output.docx", _
FileFormat:=wdFormatDocumentDefault
'Run editing macros, then save and close the new file
EditMacro1
EditMacro2
ActiveDocument.Save
ActiveDocument.Close
'Compare the original and revised files and generate the comparison in oDoc
oDoc.Compare Name:="Output.docx", _
CompareTarget:=wdCompareTargetCurrent, _
IgnoreAllComparisonWarnings:=False, _
Authorname:="Author"
Exit Sub
End Sub
Cheers,
Chris