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 )
Worksheet: Tabelle1
Row\Col A B 1Table1 Header 2a b 3c d
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




Reply With Quote
Bookmarks