Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word 2007 Automation
Message
De
13/01/2008 18:18:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word 2007 Automation
Divers
Thread ID:
01281495
Message ID:
01281495
Vues:
58
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)
Répondre
Fil
Voir

Click here to load this message in the networking platform