Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find all OptionButtons in a Word-Template

Status
Not open for further replies.

adstam

Technical User
Feb 28, 2001
25
To help users setting up their contracts we use some large word-templates with a lot of bookmarks, autotextentries etc. The templates are controlled bij optionbuttons and a lot vb-code. All this in Word 2000.
To ease the maintenance of the templates i'm building a macro to scan the complete document on used bookmark, autotextentries, macro's etc.
For this I also need to find all the optionbuttons in the document, and expected do that with:
Code:
   For each MyForm in ActiveDocument.Formfields
         usedFormField(N) = MyForm.Name
      next[\code]
But in this way I only pick up the regular fields, not the optionbuttons. How to do this??
 
I did get the answer from Cindy Meister in the msdn.microsoft forum. The secret was using InlineShapes instead of fields.
Code:
   Dim MyC as InlineShape
   Dim MyObject as Object
   For Each My in ActiveDocument.InlineShapes
         Set MyObject=MyC.OLEFormat.Object
         Msgbox MyObject.Name
      next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top