Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting Text in Word Document
Message
 
À
09/10/2001 16:13:46
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00566173
Message ID:
00566345
Vues:
14
This message has been marked as the solution to the initial question of the thread.
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