View Single Post
  #6   Report Post  
Max Moor
 
Posts: n/a
Default

"Jezebel" wrote in
:

The search range is effectively a hidden property of the Find object.
The reference is created when the Find object is instantiated (ie,
either the Selection or the Range of which the object is a property),
and is not then changed. So while the range referenced by oRg is
redefined with each iteration, the base range through which Find is
progressing, is not.

The displayed text of a field is its Result. So you could use

oRg.Fields(1).Result


Seperately, as a matter of good programming practice, when you declare
object variables you should specify the library they belong to --

Dim oRg As Word.Range
Dim fldPg As Word.Field

It costs nothing to do this, and it will save you grief when you start
referencing other libraries (like Excel) in your projects. There are
many libraries that have Range and Field objects, and they are not
interchangeable.


HA! No Jezebel, you!

Thank you, so much. I hate hidden things, but what you say makes
perfect sense.

I appreciate your note about referencing libraries, also. As I
mentioned, I've done fairly extensive programming in VB for MS Access.
(My foray into Word is to help me ultimately re-format my Access App's
user manual, written in Word, into a set of HTML files from which I can
make a .chm help file.) Specifying whether something is an ADO or DAO
object is a similar "good practice" in Access-land. Ah, why can't
everything be simple and non-ambiguous? :-)

Again, thanks to you, Shauna, and Jay for the help. I still have
a long way to go to get my ultimate macro written, but you've all gotten
me a fair bit closer.

Thanks, Max