+ Reply to Thread
Results 1 to 2 of 2

Code help: Selecting documents into one Word document via Excel

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2010
    Posts
    2

    Code help: Selecting documents into one Word document via Excel

    Hello fellow readers,

    First: please excuse any language misstake which might occur since I am not a native speaker.

    Here is what I am trying to do:

    I want to create an Excel sheet with different lines where a Word document name is displayed and a hyperlink to that document right afterwards in another row. Now i want to select a line (multiple lines with a keyword like 'Yes' or a simple X - shouldn't really matter) and put togehter all different Word documents (starting from top to bottom) which are selected and put them into one single document which will be opened and I should be capable to change things or simply save it. I know that it is possible in Word to add different documents - but I don't know how to do it an VBA.

    It is planned to select which language should be used or whether there should be a header in front - but that 'options' aren't worrying me to much since it should be just another if clause or another hyperlink (depending on the selected language).
    The main tasks should be:
    1. Select the lines which documents should be put together - click a button 'create' or sth. similar when done.
    2. Open the first document selected (should be displayed - so Word should open - not just in background).
    3. Add all other documents to the first one.

    I know how to read code, but I am not really familiar with VBA so I would really appreciate some help - even if you only can help with some parts.

    Thanks in advance and have a nice day!

    Greetings,
    jk

  2. #2
    Registered User
    Join Date
    02-05-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2010
    Posts
    2

    Re: Code help: Selecting documents into one Word document via Excel

    Hello again,

    as far as anyone is interested in a solution - here is what I did now:

    TL;DR: basic coding if you ever want to create a single document out of many others, chosing which documents should be put together.
    (I did this to be able to create a generic document with descriptions and other information which is needed in a not determined composition)

    My description was pretty basic and the solution is a little more complex which does not mean 'harder to code'.
    I started in Excel choosing the documents I want to be put together. I also choose the path and the name of the target file.

    I stored the document links in an array and called a Word macro (if you wonder why the array has 2 dimensions - I deleted some coding since I have optional documents which can be added if needed)


    Excel macro:

    Please Login or Register  to view this content.
    In the Word macro the documents are simply but together and saved under the requested name.

    Word code:

    Please Login or Register  to view this content.
    The macro recorder helped me saving the documents - might not look as nice as it could be.

    If you have any suggestions or comments - feel free to reply.

    Regards,
    jk.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 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
  2. 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
  3. VBA Code to create n number of word documents from excel range.
    By skonduru in forum Word Formatting & General
    Replies: 1
    Last Post: 01-30-2013, 03:04 AM
  4. [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
  5. 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

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