Guest User

Untitled

a guest
Apr 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub MergeDocs()
  2.  
  3. Dim MainDoc As Document
  4.  
  5. Dim strFile As String
  6.  
  7. Const strFolder = "Q:\DTV14\Mass Changes\"
  8.  
  9. Set MainDoc = Documents.Add
  10.  
  11. strFile = Dir$(strFolder & "*.doc")
  12.  
  13. Do Until strFile = ""
  14.  
  15.     Selection.WholeStory
  16.     Selection.Copy
  17.     Documents.Open FileName:=strFolder & strFile, ConfirmConversions:=False, _
  18.         ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
  19.         PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
  20.         WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
  21.        
  22.     MainDoc.Activate
  23.     Selection.PasteAndFormat (wdFormatOriginalFormatting)
  24.  
  25. strFile = Dir$()
  26.  
  27. Loop
Add Comment
Please, Sign In to add comment