Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 14 MAY 2009 09:07:11AM Dale Jessop wrote:

Hi everyone.

I have some code which creates excel (.xls) files for reports which are required to be in a certain format, so I created a template in excel and using OLE swap in the values.

Now this is working fine but the client has just asked if we can populate an MW word document at certain points with these tables and I was wondering, if anyone has already done something similar and if its possible via OLE?

Any help would be greatly welcomed.

Cheers!


At 18 MAY 2009 05:54PM Bob Carten wrote:

Hi Dale,

I was waiting to see if someone had a solution for you.

I have added regular tables to Word documents but not Excel spreadsheets.

Two approaches I can think of:

1. Run the macro recorder in Word, paste in the excel, use the VBA editor to see the recorded commands, translate them to Basic+

2. Create the word document with the Excel table in place and easily recognized token values in the table cells, save the worksheet in XML format, then osread the xml, swap the token values for real values, osewrite to a temp location, then call Shellexecute(0, 'Print', myfile:\00\, , , 1)


At 21 MAY 2009 05:17AM Dale Jessop wrote:

Thanks Bob, I will give it a try with the macro recorder and will post my results.

Cheers! Dale.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/f4b35a337529808d852575b6004811b0.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1