>>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") && TrueCetin
Hi to all OLE and WORD97 fighters,
If anyone has problems with those named arguments, there is a header file for Word97 including all named Constants necessary. Unfortuately I forgot, where on the Microsoft-Server (
www.microsoft.com) it resides. But if someone darely needs the file I could mail it if necessary. (my mail adress is aurum@t-online.de
So long
Regine
********************************
VFP, VB, VC++ Programmers
Makers of the ==>TheMiL<== engine
for intra- and internet data processing
********************************