View Single Post
 
Old 12-16-2021, 01:19 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
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

Without access to the document, I think the following should work:
Code:
Sub Macro1()
'Graham Mayor - https://www.gmayor.com - Last updated - 16 Dec 2021
Dim oTable As Table
Dim oRng As Range
Dim oCtrl As InlineShape
Dim oCheck As Object

    Set oTable = ActiveDocument.Tables(ActiveDocument.Tables.Count)
    Set oRng = ActiveDocument.Range(0, 0)
    oRng.FormattedText = oTable.Range.FormattedText
    oRng.Select
     oTable.Delete


    ActiveWindow.View.ShowHiddenText = False

    For Each oCtrl In ActiveDocument.InlineShapes
        If oCtrl.OLEFormat.ProgID = "Forms.CheckBox.1" Then
            Set oCheck = oCtrl.OLEFormat.Object
            If oCheck.value = False Then
                oCheck.Select
                Selection.Font.Hidden = True
            End If
        End If
    Next oCtrl
lbl_Exit:
    Set oTable = Nothing
    Set oRng = Nothing
    Set oCtrl = Nothing
    Set oCheck = Nothing
    Exit Sub
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