ObjectAnchor class

Office 2013 and later

Defines the ObjectAnchor Class.This class is only available in Office2010. When the object is serialized out as xml, its qualified name is x:anchor.

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

No code example is currently available or this language may not be supported.

[ISO/IEC 29500-1 1st Edition]

anchor (Object Cell Anchor)

This element specifies the position of an embedded object or embedded control.

[Example: The following example demonstrates an embedded object whose top-left corner is at the top-left point of the cell in the first column and first row and whose bottom-right corner is offset horizontally into the cell at the fifth column and eleventh row.

<oleObject … >
  <objectPr … >
    <anchor sizeWithCells="true">
      <from>
        <col>0</col>
        <colOff>0</colOff>
        <row>0</row>
        <rowOff>0</rowOff>
      </from>
      <to>
        <col>4</col>
        <colOff>182880</colOff>
        <row>10</row>
        <rowOff>0</rowOff>
      </to>
    <anchor>
  </objectPr>
</oleObject>

end example]

Parent Elements

commentPr (§18.7.5); controlPr (§18.3.1.20); objectPr (§18.3.1.56)

Child Elements

Subclause

from (Starting Anchor Point)

§20.5.2.15

to (Ending Anchor Point)

§20.5.2.32

Attributes

Description

moveWithCells (Move With Cells)

Specifies that the object moves with its underlying cells.

[Example:

<anchor moveWithCells="true" … >

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

sizeWithCells (Size With Cells)

Specifies that the object resizes with its underlying cells.

[Example:

<anchor sizeWithCells="true" … >

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

z-order (Z-Order)

Specifies the Z-order index of the object. Higher numbers indicate higher Z-order. Objects with higher Z-order are rendered on top of objects with lower Z-order when they intersect or overlap.

[Example:

<anchor z-order="10 " … >

end example]

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_ObjectAnchor) is located in §A.2. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: