Word crashes on shape.delete

C

Cor van der Bliek

When I run this sub Word 2007 (Vista) crashes on the line that reads:
oShape1.Delete

Any ideas?

Sub Huisstijl_logox_nv()
Dim oSec1 As Word.Section
Dim oHead1 As Word.HeaderFooter
Dim oShape1 As Word.Shape
If Documents.Count = 0 Then Exit Sub
Application.ScreenUpdating = False
For Each oSec1 In ActiveDocument.Sections
If oSec1.Index > 0 And oSec1.Index <= ActiveDocument.Sections.Count Then
For Each oHead1 In oSec1.Headers
For Each oShape1 In oHead1.Shapes
If Left(oShape1.Name, 7) = "Logo_nv" Then
oShape1.Delete
End If
Next
Next
End If
Next
End Sub
 
M

Maitrefrodon

I have exactly the same problem, in the Headers too.
No solution found at this time.

Bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top