Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Replace
Message
De
13/05/2000 09:36:34
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Word Replace
Divers
Thread ID:
00369326
Message ID:
00369326
Vues:
51
Hi All,

I'm running VFP 6.0 on an NT 4.0 workstation with 128mg.

I get the message "String too long to fit" at the .application.run("Replace") command in the routine below used to replace text in a Word template.

My code creates a Word object and opens a template that contains <> and initializes:

NewText = MDY(DATE())

and calls:

DO WordRepl WITH "<>", NewText

WordRepl Routine follows:

Lparameters OldText, NewText
*
* Replace All OldText with NewText
*

WITH oWORDDOC

.Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting

.Selection.Find.Text = OldText
.Selection.Find.Replacement.Text = NewText
.Selection.Find.Wrap = 1
.Selection.Find.Format = .f.
.Selection.Find.MatchCase = .f.
.Selection.Find.MatchWholeWord = .f.
* Word.Selection.Find.MatchWildcards = False
* Word.Selection.Find.MatchSoundsLike = False
* Word.Selection.Find.MatchAllWordForms = False

.application.run("replace")

ENDWITH

I don't know how much memory the RUN command requires. I could be running out of memory on the users workstation although she has 128mg on her Win98 workstation but is running from a NT 4.0 server.

Sys(1016) returns 726624 on my workstation just prior to executing the Run command. I havn't checked her machine.

There may be a more efficient method to accomplish the Word Replace. I use this to "REPLACE" name, address, and other data in the template also. If you know a better way I would appreciate you sharing it with me. TIA.

Regards,

Paige
Répondre
Fil
Voir

Click here to load this message in the networking platform