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 / July 2003

Tip: Looking for answers? Try searching our database.

Shapes in header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sander Lablans - 31 Jul 2003 14:07 GMT
Can someone tell me if it is possible to access the properties of shapes
that are 'hidden' in the header of a word-document, without having to use
the following code:

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
  &
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Example:
---------------------------------
Sub test()

 Dim shape As Variant
   
 ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
   
 For Each shape In
ActiveDocument.ActiveWindow.Selection.HeaderFooter.Shapes
   
   Debug.Print shape.Name
       
 Next shape

 ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
   
End Sub
----------------------------------

I would think that it is possible to access those shapes directly, instead
of having to revert to the header/footer view.

I am using Word2000.

Thx,

Sander
Dave Lett - 31 Jul 2003 14:39 GMT
Hi Sander,

You can get at the inlineshapes collection from a range object, as in the
following:

Dim oRng As Range
Dim oShp As InlineShape
Set oRng = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range

For Each oShp In oRng.InlineShapes
   Debug.Print oShp.Height
Next oShp

However, I'm not sure how you'd od that with a shapes collection.

HTH

> Can someone tell me if it is possible to access the properties of shapes
> that are 'hidden' in the header of a word-document, without having to use
[quoted text clipped - 32 lines]
>
> Sander
 
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.