B
banjotan
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi everyone,
I'm looking for a way to combine multiple Word documents into a single document without copying and pasting or using the "Insert File" command. I work as an editorial assistant at a publisher, and this kind of macro would make creating files for the Library of Congress CIP program much faster!
I found a macro online (here: http://www.gaebler.com/How-to-Combine-Multiple-Word-Documents-Into-One-Document.htm), but a folder pointer looks like it will only work on a PC.
How would this be coded for the Mac?
Const strFolder = "C:\Book\Chapters\"
Here's the whole macro:
Sub MergeDocs()
Dim rng As Range
Dim MainDoc As Document
Dim strFile As String
Const strFolder = "C:\Book\Chapters\" '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 very much!
Jonathan
I'm looking for a way to combine multiple Word documents into a single document without copying and pasting or using the "Insert File" command. I work as an editorial assistant at a publisher, and this kind of macro would make creating files for the Library of Congress CIP program much faster!
I found a macro online (here: http://www.gaebler.com/How-to-Combine-Multiple-Word-Documents-Into-One-Document.htm), but a folder pointer looks like it will only work on a PC.
How would this be coded for the Mac?
Const strFolder = "C:\Book\Chapters\"
Here's the whole macro:
Sub MergeDocs()
Dim rng As Range
Dim MainDoc As Document
Dim strFile As String
Const strFolder = "C:\Book\Chapters\" '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 very much!
Jonathan