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

N

Novice

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
 
P

Peter Hewett

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
 
Joined
Jul 2, 2012
Messages
1
Reaction score
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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top