OCX Form Field Collection

P

Peter

Form fields inserted into a document from the Forms toolbar can be accessed
by ActiveDocument.FormFields("formfieldname"). This does not work for fields
inserted into the same document from the Control Toolbox. In a Userform, you
can use the Controls collection but I can't figure out how to access the
fields inserted from the Controls Toolbox. I want to write a construct like:
For each ctl in Controls... Is there a way to do this?

Thanks,
Peter
 
C

Cindy M.

Hi =?Utf-8?B?UGV0ZXI=?=,
Form fields inserted into a document from the Forms toolbar can be accessed
by ActiveDocument.FormFields("formfieldname"). This does not work for fields
inserted into the same document from the Control Toolbox. In a Userform, you
can use the Controls collection but I can't figure out how to access the
fields inserted from the Controls Toolbox. I want to write a construct like:
For each ctl in Controls... Is there a way to do this?
OCX fields in a Word document are members of either the InlineShapes or the
Shapes collection. So you need to loop those collections and test the .Type
property to determine if they're controls.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
P

Peter

Thanks! I will give that a try.

Peter

Cindy M. said:
Hi =?Utf-8?B?UGV0ZXI=?=,

OCX fields in a Word document are members of either the InlineShapes or the
Shapes collection. So you need to loop those collections and test the .Type
property to determine if they're controls.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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