View Single Post
 
Old 06-05-2017, 01:31 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Shape Type 3 is a chart so I've amended the code to avoid doing anything to them
Code:
Sub EmptyShapes2()
  Dim aShp As Shape, aShp2 As Shape
  On Error GoTo ErrCatcher
  For Each aShp In ActiveDocument.Shapes
    Select Case aShp.Type
      Case msoChart
        'do nothing
      Case msoGroup
        For Each aShp2 In aShp.GroupItems
          If aShp2.TextFrame.HasText Then
            aShp2.Fill.Visible = False
          End If
        Next aShp2
      Case Else
        If aShp.TextFrame.HasText Then
          aShp.Fill.Visible = False
        End If
    End Select
  Next aShp
  Application.ScreenRefresh
  Exit Sub
ErrCatcher:
  aShp.Select
  MsgBox "Error: " & Err.Number & "  " & Err.Description & vbCr & "Shape type: " & aShp.Type
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote