Results 1 to 3 of 3
  1. #1
    MBoonie
    Guest

    Is the Selection in a FIeld? (Word 97)

    There has to be an easy way to determine if the cursor/selection is within a field code.
    I have written some code utilizing Word's FIND feature, but either because of a Word bug or because of the field type (custom Reference Manager field codes), when the search string is found in a field in either the field results or the field code, subsequent repeated searches only search within the field. (And I don't want to manipulate the found text if it's in a field, anyway.)
    I can't use the InRange method, because (apparently), fields don't have an associated range PER SE. And the FIELDS collection is unavailable if the entire field is not selected, so SELECTION.FIELDS(1) returns an error unless the whole field is selected. I don't want to error-trap using field methods such as UPDATE because the target might not be available.
    So how can I a) determine whether the string was found in a field, and [img]/forums/images/smilies/cool.gif[/img] skip the current field if I'm "in" one? Please help!

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is the Selection in a FIeld? (Word 97)

    <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=vb&Number=39243&page=&v iew=&sb=&o=&vc=1#Post39243>this</A> should keep you quiet over your lunch break (grin!)

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is the Selection in a FIeld? (Word 97)

    Try collapsing the found range/selection to its end before you do the next find.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •