Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and word97 error
Message
From
04/05/1998 01:15:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/05/1998 17:08:21
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095638
Message ID:
00096645
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform