Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Referencing fields (WinNT/Word97)

    I'm not doing very well this morning.

    Can anyone tell me how to reference a field, please? The only name I can find for the field I want is "dropdown9" (the bookmark name) and I've tried Selection.GoTo What:=wdGoToField, Which:=wdGoToPrevious, Count:=1, name:="dropdown9", and if activedocument.fields("dropdown9") = "Communication and Influencing" ('Communication and Influencing' is the first option in the dropdown) but neither of them work. I've even tried ActiveDocument.Tables(10).Cell(1, 2) = "Communication and Influencing" but the tables item doesn't seem to have an option for its value (even supposing it could read it through the dropdown field) so I just get a type mismatch error.

    <img src=/S/weep.gif border=0 alt=weep width=21 height=16> Please can someone help??!! <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    Many thanks
    Beryl M


  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Referencing fields (WinNT/Word97)

    Additional info ...

    I seem to have an insoluble problem here. The only way I can get a dropdown working (as far as I know) is to protect the section the dropdown is in ... but as soon as I protect its section, the VBA says it can't read its value because it's protected ...

    It looks like I'm going to have to use a different method to get this working ... a userform maybe ... anyone got any bright ideas?! <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>
    Beryl M


  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Referencing fields (WinNT/Word97)

    The dropdown list is a FormField object. You can read and write it if the document is protected for forms by using the Result property of the form field:

    If ActiveDocument.FormFields("dropdown9").Result = "Agitation and Propaganda" Then ...

    or

    ActiveDocument.FormFields("dropdown9").Result = "Lies, D****d Lies and Statistics"

    Warning: if you set the Result of a dropdown field to something that is not an item in the list, it will be added to the list!

Posting Permissions

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