You are on page 1of 1

CHAPTER 2: Text Text containers 71

Solution

Call IPageItemTypeUtils::IsTextFrame.

Sample code

SnpManipulateTextFrame::IsTextFrame code snippet

Navigating to the text frame for a page item


Suppose you have a reference to a page element (that could have been obtained through a selection, for
instance). You can navigate to the associated text container object(s) for that page element, assuming they
exist.

Solution

1. Obtain the hierarchy (IHierarchy) interface from the page item object. The text container objects are
maintained as part of the page item hierarchy.

2. Child 0 (zero) on the hierarchy is a column object (kMultiColumnItemBoss) that represents the set of
text columns an individual page item can have.

3. With respect to the hierarchy (IHierarchy) on the multi-column object, each child is an individual frame
(kFrameItemBoss), representing one column of text in the page item.

4. To get the parcel related to a particular frame, use the IParcel interface on the frame item boss object
(kFrameItemBoss).

5. If you are interested in other parcels associated with the frame (for example, for a footnote), note the
frame (kFrameItemBoss) object does not maintain the association. A list of all parcels used to display
text for a particular story is provided through the frame list boss object (kFrameListBoss). You can
obtain this interface from the frame item (kFrameItemBoss) using IParcel::QueryParcelList.

Sample code

SnpManipulateTextFrame::InspectTextFrame code snippet

Navigating to the text frame for text on a path


Suppose you have a reference to a page element (that could have been obtained through a selection, for
instance). You can navigate to the associated text container object(s) for text that might appear on the
item’s path.

Solution

1. Obtain the hierarchy (IHierarchy) interface from the page item object (kTOPSplineItemBoss). The text
container objects are maintained as part of the page item hierarchy.

2. Child 0 (zero) on the hierarchy is a column object (kMultiColumnItemBoss) that represents the set of
text columns an individual page item can have.

You might also like