Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page break problem in controlling Word from VFP
Message
From
28/06/2003 17:17:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00804882
Message ID:
00805049
Views:
33
>Thank you for your help. But I can't seem to get
>that code past the FoxPro compile step; it flags the line ---
>Selection.InsertBreak Type:=wdPageBreak as a syntax error.

That is the VBA syntax, which VFP doesn't accept this way (basically, VFP doesn't understand named parameters).

If you save the macro in Word, you get exactly this command. Now, if you click on the "InsertBreak" command and press F1, you get the alternative syntax:
expression.InsertBreak(Type)
with the type within parentheses.

Word won't understand the constant wdPageBreak, either, until you get its numerical equivalent and define it as a constant. This can be done easiest with one of the downloads from the UT - search for "download"; there are several versions (for instance, download #9409).

The "expression" part, on the left, must be replaced with a range or selection object.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform