Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chunks = Round(Len(replace) / 250, 0)
- If Len(replace) Mod 250 > 0 Then chunks = chunks + 1
- If chunks = 1 Then
- .Execute FindText:=search, ReplaceWith:=replace, replace:=wdReplaceAll
- Else
- .Execute FindText:=search, ReplaceWith:="{1}", replace:=wdReplaceAll
- ' Replace the text in chunks of less than 255 characters
- For i = 1 To chunks
- chunk = Mid(replace, ((i - 1) * 250) + 1, 250)
- If i < chunks Then chunk = chunk & "{" & (i + 1) & "}"
- .Execute FindText:="{" & i & "}", ReplaceWith:=chunk, replace:=wdReplaceAll
- Next i
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement