Group: microsoft.public.word.vba.general
From: "Graham Mayor"
Date: Saturday, April 05, 2008 9:04 AM
Subject: Re: Deleting text boxes with red line or text


Dim aShape As Shape
Dim oRng As Range
Application.ScreenUpdating = False
With ActiveDocument
For Each aShape In .Shapes
If aShape.Type = msoTextBox Then
With aShape
If .Line.ForeColor = wdColorRed Then
.Delete
ElseIf .TextFrame.HasText Then
Set oRng = .TextFrame.TextRange
If oRng.Font.Color = wdColorRed Then
.Delete
End If
End If
End With
End If
Next aShape
End With
Application.ScreenUpdating = True


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


JayM wrote:
> Is it possible to use VBA to delete text boxes in a word document that
> have a red line around them (or with red text in)?
>
> If so can you point me in the right direction for the code
>
> Many thanks
>
> JayM