Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changes in Word VBA in W2002?
Message
De
09/03/2004 14:55:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Changes in Word VBA in W2002?
Divers
Thread ID:
00884544
Message ID:
00884544
Vues:
49
I have this MS Word automation code in an application that has been running for at least ten years:
WITH toTable
	* Set borders
	.Borders(wdBorderTop).LineWidth = wdLineWidth225pt
	.Borders(wdBorderLeft).LineWidth = wdLineWidth225pt
	.Borders(wdBorderBottom).LineWidth = wdLineWidth225pt
	.Borders(wdBorderRight).LineWidth = wdLineWidth225pt
	.Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
	.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
ENDWITH
Where "toTable" is an object reference to a Word table.

It works just fine in all prior versions of Word, but in Word XP (2002) the lines break with an OLE error -- "'LineWidth' is not a by reference property..."

Yet when I manually create a macro in Word 2002 to do the same thing, it produces the following VB code:
    With Selection.Tables(1)
        With .Borders(wdBorderLeft)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth050pt
            .Color = wdColorAutomatic
        End With
Looks pretty much identical to me. Anybody know what's up here?
Ray Roper
Répondre
Fil
Voir

Click here to load this message in the networking platform