Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Find and Replace

Status
Not open for further replies.

zollo9999

Programmer
May 12, 2002
95
AU
Hi Dudes
Does anyone have any experience using the Word Find Object and Execute method with the ReplaceWith parameter?
Code:
objRange.Find.Execute FindText:="List", Replacewith:=strList, Replace:=wdReplaceOne
I get an error when strList is around 280 characters long, but not around 220 characters.
I suspect a limit to the size of the replacewith parameter to probably 255 characters.

The string does include several Char(13) or Char(10) (cant remember) which is used for a line break to make the string look like a list. I can't see that as a problem as it work for short lists but not for a very long list.

My solution is a bit clutzy. Check for length, cut string in two and use two List placeholders like strList1 and StrList2


More details are here

Thanks for your help!


Zollo VBA Developer
[thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top