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:
  1. For Each styRange In oApp.ActiveDocument.StoryRanges
  2.                 With styRange.Find
  3.                           .Text = "<<" & VSFlexGrid1.TextMatrix(0, c) & ">>"
  4.                           .Replacement.Text = TextToReplace
  5.                           .Forward = True
  6.                           .Wrap = wdFindContinue
  7.                           .Execute Replace:=wdReplaceAll
  8.                          
  9.                     End With
  10.                     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