View Single Post
 
Old 07-11-2019, 09:58 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

The following will extract the data to an worksheet including the values from the checkboxes. Extract data from forms You can save the worksheet as CSV.
The basic code to get the value from a checkbox content control is
Code:
Sub Macro1()
Dim oCC As ContentControl
Dim objCC As Object
Dim strData As String
    Set oCC = ActiveDocument.SelectContentControlsByTitle("SportsCheckbox").Item(1)
    If oCC.Type = wdContentControlCheckBox And Val(Application.Version) > 12 Then
        Set objCC = oCC
        If objCC.Checked Then
            strData = True
        Else
            strData = False
        End If
        MsgBox strData
    Else
        MsgBox "Not a checkbox"
    End If
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