|
-
Jun 16th, 2005, 10:38 PM
#1
Thread Starter
Lively Member
Error No 5854 : String Parameter Too Long
Dear Friends,
I am using FIND & REPLACE feature of Word object in my application.
The value which I want to replace is coming from database.The problem is sometimes the value fetched from database is too long nad yhe program generates this error
5854
String Parameter Too Long
Following is the Code snippet from my programme
VB Code:
For Each styRange In oApp.ActiveDocument.StoryRanges
With styRange.Find
.Text = "<<" & VSFlexGrid1.TextMatrix(0, c) & ">>"
.Replacement.Text = TextToReplace
.Forward = True
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Next styRange
I think Replacemnet.Text is not able to hold a larger string.
Can any one help for this.
I m waiting for your replies friend.
Thanks
-Sachien
-
Jun 16th, 2005, 11:31 PM
#2
Re: Error No 5854 : String Parameter Too Long
you are right, on testing the max length for replacement.text is 255
change you macro to like this
VB Code:
With Selection.Find
.Text = "mytest"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Execute
End With
Selection = yourstring
pete
-
Jun 19th, 2005, 11:02 PM
#3
Member
Re: Error No 5854 : String Parameter Too Long
What do u mean by Selection = yourstring..please explain...
-
Jun 21st, 2005, 05:10 AM
#4
Re: Error No 5854 : String Parameter Too Long
yourstring is a variable with the string you want to replace into the selection, there is no limit on the string length here (or if there is i don't know what it is, but much bigger than 255)
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|