Consulting

Results 1 to 6 of 6

Thread: Solved: Control Word from Excel

  1. #1

    Solved: Control Word from Excel

    First, let me say I LOVE this forum. I have learned so much and have been able to accomplish so much with the help I've received.

    Here's what I have. I have one excel macro (thanx XLD) that splits a large table (>5000 rows) into smaller tables with headers then assigns those smaller tables to named ranges. I have a word macro that creates a user specified number of bookmarks in word. Then I have another excel macro (thanx Dr. J) that uses those named ranges to "push" the tables into the word document.

    Instead of having the user jump between excel and word, can I create the bookmarks in word from excel based on the number of named ranges in the file?

    Again, thank you everyone for your time and help.

    Kathyb0527

  2. #2
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    835
    Location
    Creating book marks from XL are possible but... do you really want to? A bookmark is a Word holder of information in a specified Word location. A table is somewhat similiar, are you sure you don't want to skip the bookmarks and just use Word tables only? Maybe abit more info to bring the rest of us up to speed Dave
    ps. Why not just use XL table to Word table all done from XL?

  3. #3
    Hi Dave,
    I'm using a client "boiler plate" and they insist on the tables being inserted as pictures (sorry, forgot that part in my original post). I'm also going to need to put table titles on each page.
    If there is an easier/better way, I'm all for it.

    Thanks,
    Kathyb0527

  4. #4
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    835
    Location
    Hi Kathy. I'm not sure what your final objective is? The "boiler plate" I take it is a .dot file that already contains bookmarks? If not, you can create bookmarks from XL to insert into Word but you then need to specify their location in the Word doc. Do you want to build the entire .doc each time? The tables being inserted as pictures I take it are XL tables that you are pasting to Word bookmarks? I'm not sure why you are currently jumping between Word and XL? Maybe a bit more info. Dave

  5. #5
    Dave,
    Sorry if I'm not being clear. I have an Excel table that is >5000 rows that needs to be inserted into a report (.doc) as pictures (client requirement). There are no other bookmarks in the document. The process I have now does this, but the user needs to run a macro in excel to get the number of tables (pages in word). Run another macro in the word document to insert the correct number of bookmarks. Then run a third macro in excel to insert the tables as pictures into the word document.
    I'm really just looking to streamline the process. However, knowing the location in the document to insert the bookmarks is a problem since it will change with each report. The macro I run now is based on the cursor position.

  6. #6
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    835
    Location
    http://www.vbaexpress.com/forum/showthread.php?t=28845
    has some stuff about using the number of characters as a locator to insert Word tables (it could just as well be bookmarks inserted. Also, pictures of ranges can be placed in Word table locations). I would suggest using XL to build a new .doc every time and control all the Word formating from XL. Perhaps a few links to the other threads involved would be helpful. Dave

Posting Permissions

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