I have 3 different Shapes at the top of the document. Now I'm trying to
write code that will, depending on which optionbox is selected in the
userform, delete other Shapes. (Or bring them to front - sent back). I have
code that will delete the selected shape in the header but this is not
working properly. Thanks!
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes("Picture 9").Select
Selection.ShapeRange.Delete
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Helmut Weber - 07 Apr 2006 10:44 GMT
Hi Senad,
you don't have to select anything
and you don't have to use activepane.
Have a look at this one,
just to show the principle,
and step though it in singlestep mode [F8].
Dim rHdr As Range
Dim oShp As Shape
With ActiveDocument.Sections(1)
Set rHdr = .Headers(wdHeaderFooterPrimary).Range
End With
For Each oShp In rHdr.ShapeRange
oShp.Visible = msoFalse
oShp.Visible = msoTrue
Next

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000