General information
Category:
COM/DCOM and OLE Automation
>Don,
>How are you putting the text into your document? have you tried putting it into the clipboard?
>store mytable.thismemofield to _cliptext
Well, I am using the EXECUTE() method of the FIND object.
As in ...
cDataDate = dtoc(date())
oWord = CreateObject("Word.Application")
oWord.visible = .t.
oDocument = oWord.Documents.Add("Tap.dot")
oRange = oDocument.Range
with oRange.Find
.Text = "" && The text we are to FIND
.Replacement.Text = cDataDate && The text to replace it with
.Execute(,,,,,,,,,,wdReplaceAll) && Do it throughout document
endwith
Now this works find as long as the text you are replacing it with has less
than 255 characters.
For over 254 characters I have devised this little scheme which works but
may certainly be classified as a 'grunge'.
cSecondaryRecommendations = alltrim(recommends) && contents of a memo field
cText = ""
nMax = len(cRecommendations)
nSpot = 1
do while .t.
.Text = cText
cReplacementText = substr(cRecommendations,nSpot,250)
.Replacement.Text = cReplacementText
.Execute(,,,,,,,,,,wdReplaceAll)
nSpot = nSpot + 200
if nSpot > nMax
exit
endif
cText = right(cReplacementText,50)
enddo
endwith
Previous
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