Oh yeah I did try on Word 2003 and still reproduce the error.
What error exactly (I know, string too long!) and under what circumstances?
Please post code that is failing and indicate where.
So, you know what, we still haven't figured out how to position the
Selection to the Range's found text!
First of all, when you said in an earlier post that it's not the ticket what
is your problem with RangeObject.Select? Are you saying it does not select
the Range?
Secondly, I'll ask again, why are you so intent on using the Selection? Greg
has demonstrated how to use a Range. There are two (related) issues with
using the selection - it reflects what you are doing on screen in full view
of the user and this can be annoying because the screen can flicker and also
it is inefficient.
--
Enjoy,
Tony
Iv'e not really heard of the AutoText except in the searches for the dreaded
run-time error 5854.
Oh yeah I did try on Word 2003 and still reproduce the error.
In my case I don't need Replace all, there is a preliminary run-through of
the document that occurs. It is preparation for the database queries, and
then afterwords the replace is within an overall ForEach loop.
So, you know what, we still haven't figured out how to position the
Selection to the Range's found text!
Mike,
My website mainly addresses the limitation of "finding" text that is longer
than "255" characters. Your find text <Additional_Items> is not the
problem.
The "replace" text limitation is easily overcome using the contents of the
clipboard or an autotext (Replace All) works in both cases.
Neither method you have found or that I proposed invokes "Replace All" and
so while it appears to the observer to be a find and replace operation it is
actually more of a "find and then change what is found" ;-)
I don't think there is anything wrong with using the selection.typetext
method. I have just gathered from nosing around in these groups that range
seems to be preferred over selection when possible. I believe it may be a
little quicker, but for most jobs the advantage may be negliable.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
I am beginning to wonder, is it maybe a version thing?
I have to support Word 2000 and perhaps that is why my environment errors
when placing 256 characters into Range.Text
I am guessing that the code below is you stating that it is OK to exceed 255
characters? If so I am confused as to why you would demonstrate that while
your web page shows how to alleviate the error?
At any rate, what might your apprehensions be with using Selection.TypeText
after having found with the Range object, is there an issue of some sort
that I should be aware of?
I have been thinking that, similar to a cursor, we'd simply move it to where
the Range.Find is now pointing and TypeText into the location.