Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String Too Long to Fit
Message
From
13/05/2000 10:26:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/05/2000 09:22:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00369164
Message ID:
00369336
Views:
13
>Hi Cetin,
>
>I'm running VFP 6.0 on an NT 4.0 workstation with 128mg.
>
>It appears that I have happened upon an anomaly that others may have encountered also.
>
>In a SQL Select statement that has the parameter 'Into Table TableName', if TableName is not in the path I get a "String too long to fit" message on the entire Select statement of course.
>
>In the app I'm currently have a problem with I setup the following:
>
>lcTempDir = "C:\CVS\"
>
>other code...later after creating a Word Object:
>
>lcDocument=lcTempDir+"BetExp01.doc"
>.Documents.open(lcDocument)
>
>If BetExp01.doc is not in the path I get a "String too long to fit" message at the .Documents.open(lcDocument) statement.
>
>I've resolved these problems but now 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.
>
>NewText = MDY(DATE()) && Thanks to Bret
>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


Hi Paige,
As I could see you run a macro named "replace". Guessing "replace" does "replace" :) I would suggest directly using :

.Range.Find.Execute(TxtToFind,,,,,,,,,ReplTxt,wdReplaceAll)

OTOh seeing merge delimiters I guess it's a replacement of mergefield with a static value. Why not directly change merge field value. If there is a problem in format then you could simply use string type.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform