(Msg. 1) Posted: Wed Aug 27, 2008 3:07 am
Post subject: Word crashes on shape.delete Archived from groups: microsoft>public>word>application>errors (more info?)
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
(Msg. 2) Posted: Tue Sep 23, 2008 7:56 am
Post subject: RE: Word crashes on shape.delete [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I have exactly the same problem, in the Headers too.
No solution found at this time.
Bye
"Cor van der Bliek" wrote:
> 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
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum