Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting Text in Word Document
Message
From
10/10/2001 15:01:03
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00566173
Message ID:
00566598
Views:
10
BINGO ! That worked.

So, apparently when you execute myRange.Find.Execute() it changes the value of myRange to the range of what was found !!! Is that correct ?
It would be nice if there was a clear understanding of all of these properties and methods somewhere that explained things in simple terms. Yes, I know, there is a CHM file with all of this stuff in it ... but I have yet to be able to make sense of anything I wish to use and to be able to use it in VFP.





>Hi!
>I think you need something like this:
>
>myRange = oWord.ActiveDocument.Content
>With myRange.Find
>	.ClearFormatting
>	.Forward = .T.
>	.Text = "Text to search"
>	.Execute
>	If .Found
>		MyRange.Text = "A very long text to replace"
>	EndIf
>EndWith
>
>>I am working on a project where I am using a template document (DOT) from WORD and VFP to produce a final document. I am finding that putting in little tokens like or and then searching and replacing using the FIND object works quite well. However, there are places where I need to put in a large quantity (memo field) of text and the FIND object balks at anything over 254 characters in length. So I am stuck again.
>>
>>I would like to use the FIND object to at least find the spot it needs to go and then perhaps use INSERTAFTER ... or something like that to put the entire contents of the memo field into it.
>>
>>Or, something I just thought of ... Maybe I could use the last 50 characters of the text I just inserted for the next search and then replace it with those same 50 characters plus 200 more , etc ,etc , until the entire contents of the memo field have been inserted. A pretty convoluted method to be sure but if it works so what ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform