Results 1 to 2 of 2

Copy multiple word documents into one new word document

Threaded View

mattmar Copy multiple word documents... 08-24-2020, 05:57 AM
vba_php Re: Copy multiple word... 08-24-2020, 01:36 PM
  1. #1
    Registered User
    Join Date
    08-20-2020
    Location
    Milan
    MS-Off Ver
    2016
    Posts
    13

    Copy multiple word documents into one new word document

    Hi All,

    I am new in VBA and would like to asking some help.
    I have a list of word document in excel in range B3:B40. I would like to copy the document in the list and paste to a new document without changing the page format.
    I already tried the code below, it give me "run time error 13". Can anybody help with this situation?
    Thanks in advance for any help.

    Application.ScreenUpdating=false
    
    set objword = createobject("Word.Application")
    set objdoc = objword.Documents.Add
    objword.visible = true
    
    set objselection = objword.Selection
    Folderpath = "C:\desktop"  'where I save the word document that would be combined
    
    set objtempword = createobject("Word.Application")
    set tempdoc = objword.documents.open (Folderpath & "\" & Sheet1.Range ("B3:B40")
    set objtempselection = objtempword.selection
    tempdoc.range.select
    tempdoc.range.copy
    objselection.typeparagraph
    objselection.paste
    tempdoc.close
    Last edited by mattmar; 08-24-2020 at 06:08 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Choose multiple Word-Documents via UserForm TextBox and combine them to Master Word-Doc
    By ODeveloper in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-15-2015, 09:25 AM
  2. [SOLVED] VBA in Word, how to copy cells from a table into another word document that contentcontrol
    By reesjordan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2015, 04:39 AM
  3. Split a single word document into multiple word documents
    By CaptainCool in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2014, 03:31 AM
  4. Batch Compile 100+ multiple word documents into a single word document
    By JamesFrames8 in forum Word Formatting & General
    Replies: 4
    Last Post: 04-03-2014, 08:49 PM
  5. Replies: 5
    Last Post: 01-20-2014, 06:25 AM
  6. [SOLVED] Separate pages from one main word document to multiple documents
    By bonny24tycoon in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2012, 06:53 PM
  7. how to send documents from document imaging to word?
    By JBHarriman in forum Excel General
    Replies: 0
    Last Post: 01-30-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1