Replacement text in story range too large to execute

R

rita

Hi,

The following is an example of code that compiles but will not run when the
string variable strTextToBeInserted is too large. Is there a way around this
so that I can copy huge chunks of text to the desired storyrange (in this
case a text box)?

Set stryRng = docTargetDocument.StoryRanges(wdTextFrameStory)

With stryRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Insert Here"
.Replacement.Text = strTextToBeInserted
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With

Thanks in advance for any ideas,
Rita
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top