Dear all,
That might be more a message in a bottle because WORD VBA is not the most looked for but I take my chance on this active forum.
What I would like to do: I sent a WORD2010 document into review and I collect the reviews from my colleagues as track changes. I would like to combine all track changes versions into one document (not combine one after another) when I call the macro from the original document that has been sent into review. The combine option review from Word2010 becomes readily limited when you have more than 5 documents. You understood me as a person always looking to sharpen my tools to avoid reptitive task
Ok so here I look around on VBAexpress FORUM, MSDN forums as Stackoverflow forum. I assembled bits of code and - yes - this is not working
This is ugly - I know - and I will be grateful for any help provided. I also read that I might need .Collapse and .MainDoc.Range but really no clue
That's it for my bottle
That might be more a message in a bottle because WORD VBA is not the most looked for but I take my chance on this active forum.
What I would like to do: I sent a WORD2010 document into review and I collect the reviews from my colleagues as track changes. I would like to combine all track changes versions into one document (not combine one after another) when I call the macro from the original document that has been sent into review. The combine option review from Word2010 becomes readily limited when you have more than 5 documents. You understood me as a person always looking to sharpen my tools to avoid reptitive task
Ok so here I look around on VBAexpress FORUM, MSDN forums as Stackoverflow forum. I assembled bits of code and - yes - this is not working
Code:
Sub mergeTrackChanges()
'variables will change
Dim strFile as String, strFolder as String
Dim Count as Long
Dim i as integer
Dim v() as String
Dim files as String
'Let's open the folder that contains all track changes reviewed documents
'This part works fine
With Application.FileDialog(msoFileDialogFolderPicker)[INDENT].Title = "Pick your favorite folder for magic macro to happen"
.AllowMultiSelect = True[/INDENT]
[INDENT]
If .Show Then[/INDENT]
[INDENT=2] strFolder=.SelectedItems(1) & Application.PathSeparator[/INDENT]
[INDENT]Else[/INDENT]
[INDENT=4][/INDENT]
[INDENT=2]Exit Sub[/INDENT]
[INDENT]End if
[/INDENT]
End With
Count=0
strFile = Dir$(strFolder & "*.doc*")
' this is the bit of code that doesn't work. I also suspect I should include in the above with...If statement
v=Split(files,vbCr)
For i=1 to UBound(v)
[INDENT=2][/INDENT]
[INDENT]ActiveDocument.Merge FileName:= v(i), _
Mergetarget:=wdMergeTargetCurrent, DetectFormatChanges:=True, _
UseFormattingFrom:=wdFormattingFromCurrent, addtorecentfiles:=False
DoEvents[/INDENT]
Next i
End Sub
This is ugly - I know - and I will be grateful for any help provided. I also read that I might need .Collapse and .MainDoc.Range but really no clue
That's it for my bottle