PDA

View Full Version : Solved: How do I delete autoshape lines



pimpzter
08-03-2012, 05:51 AM
I have struggled with this for 2 weeks now and I realize I need to ask for help. I am trying to write a macro that deletes the line autoshape. I can make it where all autoshapes get deleted but this is not what I need.. Is there a way to specify just the "line" autoshapes? I tried creating a macro and inserting these line and deleting them and they are being names "line 121", "line 122".. so if its possible to maybe use some sort of wildcard..

thank everyone in advance who takes the time to have a go at this one. :banghead:

gmaxey
08-03-2012, 02:22 PM
I may be overlooking the complexity of your situation, but how about:

Sub ScratchMacro()
'A quick macro scratch pad created by Greg Maxey
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
If oShp.Type = msoLine Then
oShp.Delete
End If
Next
End Sub

pimpzter
08-06-2012, 02:33 PM
worked like a champ thanks very much. dont know why I was struggling with that one so much.