Floating Objects
- 3 minutes to read
The object in a document can be anchored in one of two ways: either inline, which means that the object is displayed within the text stream, or floating. Floating means that the object is strictly positioned, absolutely or relatively within the document, disregarding the text flow. To specify how text flows around the object, the text wrapping type is used.
To insert a floating picture into the document, use the InsertFloatingObjectPictureCommand command accessible at the Insert -> Illustrations command button group in in bar or Ribbon UI. Note that a different command is used to insert inline pictures.
To insert a floating text box, use the InsertFloatingObjectPictureCommand command accessible at the Insert -> Text command button group in bar or Ribbon UI.
A floating object is anchored to a document range, but can be positioned anywhere on the page that contains the anchor. When you insert a floating object in a certain document position, the anchor is located at the beginning of the first paragraph that contains the specified position.
End-users can drag, resize and rotate floating objects using selection handles. The Floating Object Layout Dialog enables end-users to change the position of an object, to specify how the text is wrapped around the object and rotate the object to a certain degree.
A number of commands is available on the Picture Tools Ribbon page or a command bar of the same name. The commands enable you to modify the fill and outline of floating objects and to specify how they are positioned in the document.
You can access and manipulate floating objects in code via the corresponding API. Classes relevant to floating objects are listed in the following table.
Object | Description | Exposed by |
---|---|---|
An object that can be placed above and below the text layer of the document, as well as within the document, with text surrounding it. | ||
A collection of shapes in a document. | ||
Specifies to what the horizontal position of a shape is relative. | ||
Specifies to what the vertical position of a shape is relative. | ||
Specifies the horizontal alignment of a shape. | ||
Specifies the type of vertical alignment to apply. | ||
Contains formatting information for the shape's border. | ||
Fill formatting for a shape. | ||
Gets a picture residing in the floating object. | ||
Provides access to content of the text box. |