Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub CombineDocs()
ChangeFileOpenDirectory "C:\Andy\Test\"
Application.MergeDocuments OriginalDocument:=Documents("OriginalDoc.docx") _
, RevisedDocument:=Documents("Document one.docx"), Destination:= _
wdCompareDestinationOriginal, Granularity:=wdGranularityWordLevel, _
CompareFormatting:=True, CompareCaseChanges:=True, CompareWhitespace:= _
True, CompareTables:=True, CompareHeaders:=True, CompareFootnotes:=True, _
CompareTextboxes:=True, CompareFields:=True, CompareComments:=True, _
CompareMoves:=True, OriginalAuthor:="MyOriginal", RevisedAuthor:= _
"MyRevDoc", FormatFrom:=wdMergeFormatFromPrompt
End Sub
Sub CombineDocs()
Dim MyPath As String
Dim fileName1 As String
Dim fileName2 As String
Dim doc1 As Document
Dim doc2 As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.Filters.Add "Word files", "*.docx; *.doc", 1
.Title = "Select Original Document"
.Show
fileName1 = .SelectedItems(1)
End With
Set doc1 = Documents.Open(fileName1)
MyPath = doc1.Path & "\"
fileName2 = MyPath & Dir(MyPath)
Do While fileName2 <> "" And fileName2 <> fileName1
Set doc2 = Documents.Open(fileName2)
ChangeFileOpenDirectory MyPath
Application.MergeDocuments OriginalDocument:=Documents(doc1) _
, RevisedDocument:=Documents(doc2), Destination:= _
wdCompareDestinationOriginal, Granularity:=wdGranularityWordLevel, _
CompareFormatting:=True, CompareCaseChanges:=True, CompareWhitespace:= _
True, CompareTables:=True, CompareHeaders:=True, CompareFootnotes:=True, _
CompareTextboxes:=True, CompareFields:=True, CompareComments:=True, _
CompareMoves:=True, OriginalAuthor:="MyOriginal", RevisedAuthor:= _
"MyRevDoc", FormatFrom:=wdMergeFormatFromPrompt
doc2.Close
doc1.Save
fileName2 = MyPath & Dir
Loop
End Sub