Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and word97 error
Message
From
02/05/1998 14:18:36
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
 
 
To
02/05/1998 14:15:37
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095638
Message ID:
00096526
Views:
25
>Hello Alexander Grigorjev,
>
> Nowly i did what you saw but i'm yet have problem now the VFP shows me a message saying "Missing operand"
>
> Do you know are can be?
>
> Thank you very much

I'm using the follow sintax:
>
>PUBLIC oWordDocument RegistroEdital
>#define wdFieldDocVariable = 64 (&H40)&& as defined in MS Word VB
>#define Type
>#define Text
>Close all
>Use Edital in 0
>Use Prod_edit in 0
>Select Edital
>
>*** set the LOCALEID to English
>nlLocaleId=sys(3004) && Save local id
>=sys(3006,1033) && We will be sending instructions in English
>oWordDocument=createobject("word.application") && Create word object
>with oWordDocument
> with oWordDocument.wordbasic
> .fileopen("c:\athenas\ath_lici\teste.doc")
> endwith
> .ActiveDocument.variables("Cidade").value = "Porto Alegre"
> oRange=.ActiveDocument.Range(0,0)
> .ActiveDocument.Fields.Add(oRange,wdFieldDocVariable, "Teste1")
> .ActiveDocument.variables("Teste1").value = "Anderson Reis Girardi"
>
> For ix= 1 to .ActiveDocument.Fields.count
> .ActiveDocument.Fields(ix).Update
> Next
>endwith
>oWordDocument.wordbasic.appshow && Show word app - Word 7.0 support
>wait clear
>=sys(3006,val(nlLocaleId))
>
>Anderson Girardi
>
>>Hello,
>>
>>The syntax of the Add function:
>>
>>Add(Range, Type, Text, PreserveFormatting)
>>
>>!!!!!!!!!!!!!
>>Range Required Range. The range where you want to add the field. If the range isn't collapsed, the field replaces the range.
>>!!!!!!!!!!!!!
>>...
>>
>>You need to use the Range object.
>>
>>Move the cursor into position where you want to insert new Field.
>>
>>The following example returns a Range object that refers to the first position in the active document.
>>
>>oRange = oWrd.ActiveDocument.Range(0,0)
>>
>>Next you can insert new Field in Document.
>>
>>oWrd.ActiveDocument.Fields.Add( oRange, wdFieldDocVariable, "YourVariableName")
>>
>>Good Luck.
>>
>>Alexander Grigorjev
Previous
Reply
Map
View

Click here to load this message in the networking platform