Shapes in header

S

Sander Lablans

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
 
D

Dave Lett

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
 

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