Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

HeaderFooter.Shapes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Senad Isanovic - 07 Apr 2006 10:00 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.