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
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, Type=wdFieldDocVariable, Text="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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only