B
banjotan
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi everyone,
I was looking for a way to combine multiple Word documents into a single document without copying and pasting or using the "Insert File" command.
I found a macro online (here: http://www.gaebler.com/How-to-Combine-Multiple-Word-Documents-Into-One-Document.htm), and I adjusted it a bit so it would work on a Mac, but it doesn't seem to work for me.
I'm hoping there's a macro expert out there who'd be willing to troubleshoot it.
Here's the macro:
Sub combine_docs()
'
' combine_docs Macro
' Macro created 5/4/10 by Jonathan Wichmann
'
Dim rng As Range
Dim MainDoc As Document
Dim strFile As String
Const strFolder = "Hard Drive:Users:jonathanwichmannesktop:SSZ-to-typeset" 'change to suit
Set MainDoc = Documents.Add
strFile = Dir$(strFolder & "*.doc" ' can change to .docx
Do Until strFile = ""
Set rng = MainDoc.Range
rng.Collapse wdCollapseEnd
rng.InsertFile strFolder & strFile
strFile = Dir$()
Loop
End Sub
Thank you so much in advance!
Jonathan
I was looking for a way to combine multiple Word documents into a single document without copying and pasting or using the "Insert File" command.
I found a macro online (here: http://www.gaebler.com/How-to-Combine-Multiple-Word-Documents-Into-One-Document.htm), and I adjusted it a bit so it would work on a Mac, but it doesn't seem to work for me.
I'm hoping there's a macro expert out there who'd be willing to troubleshoot it.
Here's the macro:
Sub combine_docs()
'
' combine_docs Macro
' Macro created 5/4/10 by Jonathan Wichmann
'
Dim rng As Range
Dim MainDoc As Document
Dim strFile As String
Const strFolder = "Hard Drive:Users:jonathanwichmannesktop:SSZ-to-typeset" 'change to suit
Set MainDoc = Documents.Add
strFile = Dir$(strFolder & "*.doc" ' can change to .docx
Do Until strFile = ""
Set rng = MainDoc.Range
rng.Collapse wdCollapseEnd
rng.InsertFile strFolder & strFile
strFile = Dir$()
Loop
End Sub
Thank you so much in advance!
Jonathan