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.

    Novice, Apr 6, 2004
    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

    HTH + Cheers - Peter
    Peter Hewett, Apr 6, 2004
    1. Advertisements

  3. Novice


    Jul 2, 2012
    Likes Received:
    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
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.