![]() |
#1
|
|||
|
|||
![]()
Hi guys,
I am trying to write a Macro to replace a string of text with another one, but I receive an error for the text to replace - run time error 5854 - string parameter is too long. I know that the string has more than 255 characters, but I cannot change it and I cannot split it in 2 commands. Code it like below: Let Address2 = "{Insert shop address}" Let Localizedaddress1 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Address2 .Replacement.Text = Localizedaddress1 .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Can you please help with how should I modify it in order to work? Thank you! Irina |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
inputing japanese string in word's macro = ?? | tyki | Word VBA | 0 | 02-29-2016 03:09 AM |
![]() |
PRA007 | Word VBA | 4 | 01-18-2016 12:00 AM |
One long string of text with ; as the delimiter | Laurie B. | Excel | 1 | 02-28-2015 03:02 AM |
![]() |
VBNation | Word VBA | 2 | 02-08-2013 07:14 AM |
Renaming Word Formfields: string too long error | silverspr | Word VBA | 7 | 01-22-2013 06:20 PM |