Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2018, 01:38 PM
quanfirem quanfirem is offline How to combine Word 2016 documents using VBA? (Mac OS) Mac OS X How to combine Word 2016 documents using VBA? (Mac OS) Office 2016 for Mac
Novice
How to combine Word 2016 documents using VBA? (Mac OS)
 
Join Date: Oct 2018
Posts: 1
quanfirem is on a distinguished road
Default 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
TLDR:


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
Reply With Quote
  #2  
Old 10-03-2019, 07:21 AM
d13engel d13engel is offline How to combine Word 2016 documents using VBA? (Mac OS) Mac OS X How to combine Word 2016 documents using VBA? (Mac OS) Office 2016 for Mac
Novice
 
Join Date: Oct 2019
Posts: 2
d13engel is on a distinguished road
Default I'm looking for that too

i have the same need here.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to combine Word 2016 documents using VBA? (Mac OS) combine 2 different word documents salimnore Word 6 05-29-2018 09:43 AM
How to combine Word 2016 documents using VBA? (Mac OS) 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
How to combine Word 2016 documents using VBA? (Mac OS) 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft