Error: "string parameter too long"?

E

Ed

I'm working with a text-based document, with every line as a separate
paragraph. Each line is 80 characters monospaced from start to paragraph
mark. This first thing I do is search for a specific character in the first
line; if it's there, then the first three lines/paragraphs are a
header/footer. I set this to a range, capture the Range.Text into a
strHeader, and delete it.

Because of the way this doc is spit out of the database, this header/footer
is repeated everywhere there was *supposed* to be a page break. So I tried:
RangeDoc.Find. Execute _
FindText:= strHeader & "^p" & strHeader, _
ReplaceWith:="^m", Replace:=wdReplaceAll

and got an error: "String parameter too long".

Any advice on making this work? Are the actual number of characters too
much for a string? Too many lines?paragraphs? Word is finicky and doesn't
like me today?

Ed
 
P

Peter Hewett

Hi Ed

The Find objects Text property is limited to 255 characters, you're obviously
exceeding that.

HTH + Cheers - Peter
 
E

Ed

Ah - it's not too long for a String, but it's too much to stuff into Text.
Okay, that makes sense. Time for Plan B! 8>)

Thanks once again, Peter.
Ed
 

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