Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-14-2022, 02:50 AM
gmaxey gmaxey is offline Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Windows 10 Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oCtl As Object
Dim oCC As ContentControl
On Error Resume Next
  For Each oCtl In ActiveDocument.InlineShapes
    If oCtl.OLEFormat.ProgID = "Forms.OptionButton.1" Then
      oCtl.OLEFormat.Object.Value = False
    End If
  Next oCtl
  For Each oCC In ActiveDocument.Range.ContentControls
    Select Case oCC.Type
      Case Is = wdContentControlDropdownList
        oCC.Type = 1
        oCC.Range.Text = vbNullString
        oCC.Type = wdContentControlDropdownList
      Case Is = wdContentControlComboBox
        oCC.Type = 1
        oCC.Range.Text = vbNullString
        oCC.Type = wdContentControlComboBox
      Case Else
        oCC.Range.Text = vbNullString
    End Select
  Next oCC
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Content Controls - Dependent Dropdown someazguy Word VBA 14 02-05-2023 08:01 PM
Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Clear Button For Specific Content Control shaun0406 Word VBA 6 06-14-2021 10:55 AM
Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Content Controls - Dependent Dropdown & Text Mightymegs Word VBA 6 05-18-2020 05:34 AM
Clear Values from All Controls on Form ScottyBee Word VBA 2 04-02-2019 09:55 AM
Clear all content controls (Text, dropdown) AND change option button values to FALSE in MS Word Form Add new row to protected form including content controls via Command Button tbrookes Word VBA 5 06-20-2016 02:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:31 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