HeaderFooter.Shapes Property

Word Developer Reference

Returns a Shapes collection that represents all the Shape objects in a header or footer. Read-only.

Syntax

expression.Shapes

expression   A variable that represents a HeaderFooter object.

Remarks

This collection can contain drawings, shapes, pictures, OLE objects, ActiveX controls, text objects, and callouts. For information about returning a single member of a collection, see Returning an Object from a Collection.

The Shapes property, when applied to a document, returns all the Shape objects in the main story of the document, excluding the headers and footers. When applied to a HeaderFooter object, the Shapes property returns all the Shape objects found in all the headers and footers in the document.

Example

This example displays a count of all the shapes in the primary header and footer of the first section of the active document.

Visual Basic for Applications
  MsgBox ActiveDocument.Sections(1). _
    Headers(wdHeaderFooterPrimary).Shapes.Count

See Also