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....
Printable View
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....
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
Pass a pointer to the string instead?
Is this VBA?
yes it is vba
find and replace can only handle 255 characters in the replace string
pete
Anything wrong with using the VBA Replace$? I just did a 100,000-char replace in about half a second.
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