View Single Post
 
Old 12-01-2023, 04:07 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
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 Gregory K. Maxey
Dim oCC As ContentControl
Dim arrTagParts() As String
Dim lngIndex As Long
Dim bDelete As Boolean
  
  For Each oCC In ActiveDocument.ContentControls
    bDelete = True
    If oCC.Type = 0 Then
      arrTagParts = Split(oCC.Tag, " ")
      For lngIndex = 0 To UBound(arrTagParts)
        If arrTagParts(lngIndex) = "Me" Then
          bDelete = False
          Exit For
        End If
      Next lngIndex
      If bDelete Then oCC.Delete True
   End If
 Next oCC
lbl_Exit:
  Exit Sub
  
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote