|
-
Jun 20th, 2005, 09:11 PM
#1
Thread Starter
Member
error 5854 String Parameter too Long in VB6
Hi,
I need to replace text more than 255 characters in word using word application in VB6. It gives me an error 5854 String parameter too long... Please help....
-
Jun 21st, 2005, 05:05 AM
#2
Re: error 5854 String Parameter too Long in VB6
find (without replace) and select the text, then input the new string into the selection
if you want exact code do a search as i put it in 2 posts very recently
pete
-
Jun 21st, 2005, 07:34 AM
#3
Re: error 5854 String Parameter too Long in VB6
Pass a pointer to the string instead?
Is this VBA?
-
Jun 21st, 2005, 07:54 AM
#4
Re: error 5854 String Parameter too Long in VB6
yes it is vba
find and replace can only handle 255 characters in the replace string
pete
-
Jun 21st, 2005, 08:27 AM
#5
Re: error 5854 String Parameter too Long in VB6
Anything wrong with using the VBA Replace$? I just did a 100,000-char replace in about half a second.
-
Jun 21st, 2005, 08:45 AM
#6
Re: error 5854 String Parameter too Long in VB6
i am sure there are many ways to do it, but the .find.replacement.text in word 2000 is max lenght of 255 characters on my machine, over that it gives an error, same problem a few others have been having
VB Code:
With Selection.Find
.Text = "mytest"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Execute
End With
Selection = mytext1 ' where mytext1 can be in excess off 255 characters
is one way to replace the selection with a longer string
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
|