General information
Category:
Coding, syntax & commands
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
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