Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to initalize Word97 from VFP6?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00156542
Message ID:
00156698
Views:
57
Juan,

If that code is clipped you forgot to set oWordDoc = to the return value of the Documents.Add() method.

According to the VBAWord8 file the erroring line looks ok. What if you move another line above it? What is the error you get? Also InchesToPoints() is a method of your oWord object so you need: .TopMargin = oWord.InchesToPoints( 1 ).

>Failing code has an inline comment beginning with <====
>
>Form.Method
>------------
>*-- let us assume that the below are valid objects
>oWord = CreateObject("Word.Application")
>oWord.Documents.Add()
>
>*************************
>FUNCTION WordDocumentSetup( oWord, oWordDoc )
>*************************
>WITH oWordDoc.PageSetup
> .LineNumbering.Active = .F. && <==== Program fails right here
> .Orientation = wdOrientPortrait
> .TopMargin = InchesToPoints(1)
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform