Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changes in Word VBA in W2002?
Message
From
09/03/2004 14:55:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Changes in Word VBA in W2002?
Miscellaneous
Thread ID:
00884544
Message ID:
00884544
Views:
48
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
Reply
Map
View

Click here to load this message in the networking platform