Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word97 and VFP Error
Message
De
29/04/1998 10:20:47
 
 
À
29/04/1998 08:46:59
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00095641
Message ID:
00095662
Vues:
19
>Hello All
>
>I'm trying to automatizate the MS-Word97 with VFP 5.0
>
>I have a word document and into this document i have a field
>{DocVariable "Cidade" \*MergeFormat }, this document is called teste.doc.
>
>In VFP i have the follow sintax:
>
>PUBLIC ObjWDdoc
>
>*** set the LOCALEID to English
>nlLocaleId=sys(3004)
>=sys(3006,1033)
>
>
>Wait wind WAITMESSAGE6_LOC nowait
>objWDdoc=crea("word.basic")
>objwddoc.APPSHOW
>objwddoc.FileOpen("C:\athenas\ath_lici\teste.doc",.t.)
>
>Here i have problem
>objwddoc.Insert(cidade, "Porto Alegre")
>The VFP shows me a message saying variable Cidade is not found.
>Anyone can help me?
>Thanks

Hello!

Why you don't use the "Word.Application" object, this object have more rich possibilities?

Try to do so:
*//----------------------------------------------

oWrd = CreateObject( "Word.Application")
oDoc = oWrd.Documents.Open( "C:\athenas\ath_lici\teste.doc")
*-- if a variable "cidade" not defined, you must add a new variable into Word document
*-- othwerwise skip this step
oDoc.Variables.Add( "cidade")
*--
oDoc.Variables( "cidade").value = "Porto Alegre"
oDoc.Fields.Update
and so on...

*//----------------------------------------------

For more information about using "Word.Application" object, see in MS Word Visual Basic help.

Alexander Grigorjev
Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform