Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert table into template using Word Automation
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Insert table into template using Word Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01554165
Message ID:
01554165
Views:
75
I am attempting to insert a table into the middle of a Word document created from a template under automation. The template has bookmarks where multiple data elements and expressions are merged. One of these bookmarks calls method code that creates the table. The table itself has only 2 columns but may easily stretch over several pages since it includes a memo field and multiple records. The table should replace the bookmark, stretching as far as necessary, and be followed by the final paragraph in the template and the company's normal signature lines. In my tests, the table routinely obliterates everything that should follow. Is this task possible? If so, how do I define the Range for the table?

The method code to create the table is based upon Tamar Granor's example in Microsoft Office Automation with Visual FoxPro. I’ve adapted and used it many times (thank you Tamar!) However, this table is a bit more complicated since it merges so much data and appears in the middle of a template. The same information has been available in a VFP report for 25+ years but now they want it in Word.
Next
Reply
Map
View

Click here to load this message in the networking platform