Why does this -> ActiveDocument.FormFields.count equal zero?

Discussion in 'Word VBA Beginners' started by Novice, Apr 6, 2004.

  1. Novice

    Novice Guest

    Hi all, I've added numerous listboxes to my document using the "Control Toolbox" Toolbar. Now when I use the following VBA:
    Dim aDoc As Word.Document
    Set aDoc = ActiveDocument
    MsgBox (aDoc.FormFields.Count)

    I get a message box that says "0".

    The reason I'm doing this is that I would like iterate over all the listboxes in the document.

    Thanks,
    Novice
     
    Novice, Apr 6, 2004
    #1
    1. Advertisements

  2. Novice

    Peter Hewett Guest

    Hi Novice

    Steve will be kicking himself now. See my post answering your question.

    ListBoxes are ActiveX controls not FormFields. That's why you've got zero
    FormFields.

    HTH + Cheers - Peter


    Novice <6tc1ATqlinkDOTqueensuDOTca>, said:

    >Hi all, I've added numerous listboxes to my document using the "Control Toolbox" Toolbar. Now when I use the following VBA:
    > Dim aDoc As Word.Document
    > Set aDoc = ActiveDocument
    > MsgBox (aDoc.FormFields.Count)
    >
    >I get a message box that says "0".
    >
    >The reason I'm doing this is that I would like iterate over all the listboxes in the document.
    >
    >Thanks,
    >Novice
     
    Peter Hewett, Apr 6, 2004
    #2
    1. Advertisements

  3. Novice

    nigel

    Joined:
    Jul 2, 2012
    Messages:
    1
    Likes Received:
    0
    Eight years on this is still riding high in Google results for FormFields and Zero, and now ContentControls have joined the party - something else to try for anyone still having trouble finding their data
     
    nigel, Jul 2, 2012
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gonzo

    formfields

    Gonzo, Feb 28, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    89
    Jean-Guy Marcil
    Feb 28, 2004
  2. Alan D.
    Replies:
    2
    Views:
    185
    Doug Robbins - Word MVP
    May 21, 2004
  3. Nick Calladine

    reading formfields in a table

    Nick Calladine, Sep 17, 2005, in forum: Word VBA Beginners
    Replies:
    3
    Views:
    190
    Greg Maxey
    Sep 17, 2005
  4. Paul Isaak

    vbCrLf displays as ? in formfields

    Paul Isaak, Jan 17, 2006, in forum: Word VBA Beginners
    Replies:
    3
    Views:
    136
    Cindy M -WordMVP-
    Jan 19, 2006
  5. Guest

    Word 2003 FormFields

    Guest, Apr 1, 2006, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    111
    David
    Apr 3, 2006
  6. Guest

    Bookmarks got empty from FormFields

    Guest, Apr 3, 2006, in forum: Word VBA Beginners
    Replies:
    4
    Views:
    117
    Charles Kenyon
    Apr 5, 2006
  7. VBA Neophyte

    Word table and formfields

    VBA Neophyte, Jul 26, 2007, in forum: Word VBA Beginners
    Replies:
    6
    Views:
    185
    VBA Neophyte
    Jul 30, 2007
  8. Werner
    Replies:
    1
    Views:
    105
    Jay Freedman
    Jan 9, 2008
Loading...