Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and word97 error
Message
De
04/05/1998 01:15:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/05/1998 17:08:21
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00095638
Message ID:
00096645
Vues:
28
>Hello I did what you saw but i yet have the same error message:
>
>Fuction Name is missing ).
>
>Thanks nowly
>
>Anderson Girardi
Hi Ander,
Following code works as intended with no error :
#define wdFieldDocVariable 64
PUBLIC oWordDocument
*** set the LOCALEID to English
nlLocaleId=sys(3004)		&& Save local id
=sys(3006,1033)			&& Sending instructions in English 
oWordDocument=createobject("word.application")	&& Create word object
with oWordDocument
	.Documents.Open("c:\temp\ander.doc")
	.ActiveDocument.variables("Cidade").value = "Porto Allegre"
	oRange=.ActiveDocument.Range(0,0)
	.ActiveDocument.Fields.Add(oRange, wdFieldDocVariable, "Teste1")
	.ActiveDocument.variables("Teste1").value = "Anderson Reis Girardi"
	.ActiveDocument.Fields.Update
	.visible = .t. 
endwith
wait clear
=sys(3006,val(nlLocaleId))
I want to warn you for one thing. When using word VB commands use positional arguments not named arguments. ie:
.ActiveDocument.Fields.Add(oRange, Type=wdFieldDocVariable, Text="Teste1")  && Wrong
.ActiveDocument.Fields.Add(oRange, wdFieldDocVariable, "Teste1")  && True
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform