Results 1 to 6 of 6

Thread: what is the best way to populate word specific locations from Excel Data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,456
    Rep Power
    10
    Hello flora,
    Welcome to excelfox

    I cannot answer fully your question as I have limited experience with Word VBA, and no experience with charts.

    I can give you one short example based on a coding which I use daily. It might give you at least one idea. But it is a bit of a long way around, - Possibly there is a better way to do it. (My way uses a lot of HTML coding , because in daily use I send the final complete text and tables, as seen in the final Word file, as an Email, automatically.)
    The coding is a bit rough and patchy, as I have done a quick modified version of an existing coding of mine. I have not explained it all too well. It is intended to give you just a taste of what I can do. If you want to take this further , and provided you are not in too much of a rush, then I can expand on a few things or explain more, etc. over the next few days..

    I am using Word 2007 and Excel 2007 for this example.

    As a short example, lets say, my Word file looks like this simple text:

    Here is my Word File, "WordFile.htm",
    WordFile BEFORE.JPG: : https://imgur.com/eyXdoTq
    WordFile BEFORE.JPG

    I would like to put here Table1.
    Here is some other text.


    (The Excel file is uploaded for you below. I had to use an external File sharing site, ( app.box.com ) for the .htm File,because that file format will not upload to excelfox . Alternatively download the .docx file below, and resave as .htm from within Word : docx to htm SaveAs.jpg : https://imgur.com/LdHyWst ).

    (It simplifies the coding to have this saved with that untypical extension, .htm . But additional coding could allow that to be saved as a normal .doc or .docx Word File)

    In an Excel file I have this:
    ExcelFile.jpg: : https://imgur.com/G20XRwo
    ExcelFile.JPG
    _____ Workbook: Excel File.xls ( Using Excel 2007 32 bit )
    Row\Col
    A
    B
    1
    Table1 Header
    2
    a b
    3
    c d
    Worksheet: Tabelle1
    The short macro routine example that I give you is also in the above Excel File, "ExcelFile.xls". (The file is uploaded for you below). I also have the total coding that you need here:
    http://www.excelfox.com/forum/showth...ll=1#post11386


    After running the routine , Sub MakeTagList() , you will get a new Word document, "WordFile2.htm" which looks like this:
    WordFile2 AFTER.JPG : https://imgur.com/1QNLExu
    WordFile2 AFTER.JPG


    This is what you need to do for the demo of what is going on:
    Download both the files. ( The Excel File and the htm Word File ). Save them anywhere, but make sure they are both saved in the same place. Run the routine , Sub MakeTagList()
    The new word doco, "WordFile2.htm" , which is produced, will show shortly for about 5 seconds.

    Let me know if you want to take this further.

    Alan



    Ref:
    http://www.eileenslounge.com/viewtop...=29556#p228710





    P.S.
    I think you may get to a larger audience of more experienced people in the area of automating Word and Excel somewhere else, such as here:
    https://www.excelforum.com/word-programming-vba-macros/
    http://www.eileenslounge.com/viewforum.php?f=30

    (If you post your question elsewhere , then you might want to mention that you already posted the question at excelfox: This is because forums usually have some Rules about "cross posting", which basically means that you must say where else you have posted the same question. http://www.excelfox.com/forum/showth...-Cross-Posters )

    Alan



    "WordFile.htm" : https://app.box.com/s/xl1l7noo2nf7znnzyz6evqaeiuu37gcz
    Attached Files Attached Files
    Last edited by DocAElstein; 07-12-2019 at 12:48 PM. Reason: Added clarity..... Download both the files. ( The Excel File and the [B]htm [/B] Word File )

Similar Threads

  1. Export data (text) Excel to Ms Word Format
    By muhammad susanto in forum Excel Help
    Replies: 0
    Last Post: 10-06-2017, 09:36 AM
  2. Replies: 2
    Last Post: 08-19-2016, 08:38 AM
  3. Replies: 1
    Last Post: 02-25-2014, 10:55 PM
  4. Replies: 3
    Last Post: 06-26-2013, 11:42 PM
  5. Populate data in form
    By Ryan_Bernal in forum Excel Help
    Replies: 4
    Last Post: 02-01-2013, 10:18 AM

Posting Permissions

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