Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2016, 04:59 AM
gmayor's Avatar
gmayor gmayor is offline How to get the MS Word Form Fields Check box associated text and their value using VBA? Windows 10 How to get the MS Word Form Fields Check box associated text and their value using VBA? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,143
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you require is as follows. The names will depend on what you have called the check boxes. The default is Checkn where n is an incrementing number

Code:
Sub Test()
'Graham Mayor - http://www.gmayor.com - Last updated - 25/11/2016 
Dim oFF As FormField
Dim strCheckBoxName As String
Dim strCheckBoxValue As String
Dim i As Long
    For i = 1 To ActiveDocument.FormFields.Count
        Set oFF = ActiveDocument.FormFields(i)
        If oFF.Type = wdFieldFormCheckBox Then
            strCheckBoxName = oFF.Name
            strCheckBoxValue = oFF.CheckBox.Value
Debug.Print strCheckBoxName & " = " & strCheckBoxValue
        End If
    Next
End Sub

__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
Entering HELP Text for Word 2010 form fields slandi Word 0 03-28-2014 08:09 AM
Duplicating form fields (check-boxes) Jānis Word 3 09-16-2012 12:09 PM
How to get the MS Word Form Fields Check box associated text and their value using VBA? Cannot enter text into form fields, Word 2007 mjr55 Word 7 04-19-2012 04:24 PM
How to get the MS Word Form Fields Check box associated text and their value using VBA? Form Fields - Create blank form text field with if statement? LAssist2011 Word 5 12-14-2011 03:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:07 AM.


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