General information
Category:
COM/DCOM and OLE Automation
Title:
Word 2007 Automation
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only