Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting Text in Word Document
Message
De
10/10/2001 15:01:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00566173
Message ID:
00566598
Vues:
11
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 ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform