Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE-Word
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00143845
Message ID:
00143858
Views:
20
>Hello,
> I got the sample from MS about the automation of MS Word. I don't understand with some statement....anyobe can help me???
> It is in VB code.
> set appword = createobject('word.application')
> with appword
> .documents.adds
> .selection.typetext text:="this is testing"
> .activedocuments.printout background:=false
> end with
>
> What does "typetext" and "background" meant????how to convert this syntax to vfp??

There are minor differences in the code.
In VB false is the same as .f. and typetext is a method.
VB also assigns variables using the set statement which isn't needed in VFP. So the following code should work:
appword = createobject('word.application')

with appword
.documents.add
.selection.typetext("this is testing")
.activedocument.printout(.f.)
endwith

You had a couple of problems in the code from VB like .activedocuments and .documents.adds. They should be singular, not plural.
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Previous
Reply
Map
View

Click here to load this message in the networking platform