Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP & MSWORD
Message
From
13/01/1999 15:48:29
 
 
To
13/01/1999 15:18:27
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00175624
Message ID:
00175671
Views:
31
>This is what was in the macro. What would this code be if it were VFP and not VB? I tried this and it doesn't work.
>Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
>Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter


Jim- wdExtend and wdAlignParagraphCenter are Word constants. You can find the value of these constants in the VBA editor by pressing F2 to open the object browser. Type in the name of the constant you are looking for and when it comes up, click on it. The value will be shown down at the bottom of the browser. After you ahve found the value of these constants, you can use the rules for translating VBA to VFP to get something like:

wdLine = 5
wdExtend = 1
wdAlignParagraphCenter = 1

oWord.Selection.HomeKey(wdExtend, wdLine)
oWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

You may have to play with it some to get the order of the parameters right...

HTH
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform