Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Word and Excel together
Message
 
To
22/05/2007 13:54:40
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01227711
Message ID:
01227731
Views:
18
>If I generate a table in Excel using automation, and then copy and paste it into a Word document also using automation, how can I control where it is placed in the Word document, or how can I get a handle on the pasted table so that it can be positioned on the page. I am selecting a bookmark in the Word document prior to the paste, but the table ends up below the bookmark and left of the document margin. I would like the table to be either at the left margin or centered on the page.
>
>Thanks
>
>with oWord
>	do recap_chart with lcPermID, lnYear
>	.ActiveDocument.Bookmarks("ExcelTable").select
>	.selection.Paste
>endwith
>
It depends on what do you "paste". Probably it appears as a table in the Word Document. Then you may get the reference to it with, say,
with oWord.Activedocument.tables
    lo=.Item(.count)
    ?lo.range.start, lo.Range.end
.......
If you wish to display it like a picture and control its position, size, etc then probably it is better to use pastespecial method or insert an OLE object. It is more easy to control the object position and dimensions than the table, which is the part of the document text.
Previous
Reply
Map
View

Click here to load this message in the networking platform