Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-22-2013, 11:03 PM
fumei fumei is offline Query list of objects and properties in VBA Windows 7 64bit Query list of objects and properties in VBA Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

You do not state what you want to do with this list. Write to another document perhaps. In any case this may help you get started.
Code:
Sub ListCaptions()
Dim oCtl As MSForms.Control
For Each oCtl In UserForm1.Controls
   If TypeOf oCtl Is MSForms.CheckBox Or _
      TypeOf oCtl Is MSForms.Label Or _
      TypeOf oCtl Is MSForms.OptionButton Then
      MsgBox oCtl.Name & vbTab & oCtl.Caption
   End If
Next
End Sub
This gets the values for the controls that DO have Captions. For example textboxes, comboboxes do NOT have Captions. Thus they are not included in the test.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add custom doc properties in "Doc properties control" eazysnatch Word 2 09-13-2017 08:08 PM
Query list of objects and properties in VBA Convert equation objects to inline objects sumjoh Word VBA 1 01-29-2013 08:38 PM
How to Query Text in MS-Excel 2010 or Import Data & Query outside of Excel? mag Excel 0 10-18-2012 11:15 AM
Query list of objects and properties in VBA Shape Objects Space Cowboy PowerPoint 4 10-04-2010 07:14 PM
NOprintable objects shadowbat Drawing and Graphics 0 07-05-2010 10:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft