Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Word method
Message
De
11/05/2001 19:29:11
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Problem with Word method
Divers
Thread ID:
00506528
Message ID:
00506528
Vues:
64
I have a problem, I dont know how to execute a Word method form VFP
At the sample below I want to protect the document, but it allways returns an
error when I call the method Protect, it returns a OLE error: unknown name
Word2000/VFP6.0 + SP5

Could someone help me please
TIA


oWordApplication = CREATEOBJECT("Word.Application")
oWordApplication.VISIBLE = .F.
oWordApplication.Documents.ADD("normal.dot", .F.)

* Select the document
oSelection = oWordApplication.ActiveWindow.ActivePane.SELECTION
oSelection.TypeText ("Test to protect this document.")

* Select Range ( all text form the document )
oSelection2 = oWordApplication.ActiveWindow.ActivePane.SELECTION.range

IF oWordApplication.ActiveDocument.ProtectionType = wdNoProtection && no protection
WITH oSelection2
.PROTECT
.TYPE = wdAllowOnlyFormFields
.PASSWORD = "free"
ENDWITH
ENDIF
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform