How to get the number of controls in a word document?

S

Simon Guo

Hi, I am a new-bie to VBA programming.
I want to know how many controls (such as textboxes, ect)
are there in a document, how could I do this?
many thanks!!
 
J

Jezebel

The general method is to check the Count property of the collection you're
interested in. If you mean form controls you can use
ActiveDocument.FormFields.Count; if you mean drawing Textboxes (which are
not normally referred to as Controls), these are included in the Shapes
collection.
 

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