#1
|
|||
|
|||
How to combine Word 2016 documents using VBA? (Mac OS)
Hi folks,
I'm sorry to post this here, I wouldn't do so unless I was getting near my wick's end. So for work I've been given a bunch (hundreds really) of .docx files in a folder. I need to find a way to merge these altogether... on a Mac. Sigh, I would know how to do this on Windows perfectly. I've spent hours looking into things online, including manually dropping each file into the Word master viewer (risky and time consuming), Automater (doesn't work on Word 2016 anymore), manually inserting and copying (for 400 files? really?) and of course VBA. I can find plenty of examples for VBA for Windows, but I'm waaay out of my depth on a mac. Sorry folks, any help would be amazingly appreciated. As stated, I've tried various variants on: Code:
Sub MergeDocuments() Application.ScreenUpdating = False MyPath = ActiveDocument.Path MyName = Dir(MyPath & "\" & " *.docx") i = 0 Do While MyName <> "" If MyName <> ActiveDocument.Name Then Set wb = Documents.Open(MyPath & "\" & MyName) Selection.WholeStory Selection.Copy Windows(1).Activate Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.Paste i = i + 1 wb.Close False End If MyName = Dir Loop Application.ScreenUpdating = True EndSub I'm looking for code to loop through a folder and merge all the .docx files in it into a single master document! Thanks so much! Last edited by quanfirem; 10-09-2018 at 01:39 PM. Reason: coding |
#2
|
|||
|
|||
I'm looking for that too
i have the same need here.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
combine 2 different word documents | salimnore | Word | 6 | 05-29-2018 09:43 AM |
Combine documents makes duplicate word | vincelge | Word | 2 | 05-15-2017 05:47 AM |
combine multiple documents word starter 2010 | bribelge | Word | 3 | 12-19-2012 09:25 AM |
OK I know its a dumb question but how can I combine word documents? | hellno187 | Word | 2 | 12-16-2012 12:32 PM |
How can a combine three seperate word documents into one? | hellno187 | Word | 0 | 09-20-2010 02:46 PM |