Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word 2007 Automation
Message
From
13/01/2008 18:18:19
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word 2007 Automation
Miscellaneous
Thread ID:
01281495
Message ID:
01281495
Views:
57
Question,
I have an app that runs Automation to build a members directory from VFP. The code run great in 2003 but is broke in Word 2007. I get a OLE Dispatch error (Value out of range) when it hits the Columns.setwidth.
Here is the code - what has changed?
Thanks for th help.

oTable = oDocument.Tables.Add( oRange,3, 2,1,1 )
oTable.AutoFormat( 0, .T., .T., .T., .T., .T., .F.,.F., .F., .F.)
oTable.BorderS.InsideLineStyle = .F.
oTable.BorderS.OutsideLineStyle = .F.
oTable.AllowPageBreaks = .F.
oTable.PreferredWidthType = 1

With oTable
.Columns[1].Setwidth(118,0)
.Columns[2].Setwidth(220,0)
.cell(1,1).Merge(oTable.cell(1,2))
.cell(3,1).Merge(oTable.cell(3,2))
.Rows[1].Range.Style = oDocument.Styles[ "Heading 1" ]
.Rows[1].Range.insertafter(mnames)
oRange.Collapse(0)
.Rows[2].Range.Style = oDocument.Styles[ "Heading 2" ]
.Rows[2].Cells[1].Range.insertafter(maddress)
.Rows[2].Cells[2].Range.insertafter(names.about)
Reply
Map
View

Click here to load this message in the networking platform