ObjectAnchor Class

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.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Spreadsheet.ObjectAnchor

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

Syntax

'Declaration
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(FromMarker), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ToMarker), FileFormatVersions.Office2010)> _
Public Class ObjectAnchor _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ObjectAnchor
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(FromMarker), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ToMarker), FileFormatVersions.Office2010)]
public class ObjectAnchor : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • FromMarker <x:from>

  • ToMarker <x:to>

[ISO/IEC 29500-1 1st Edition]

18.3.1.1 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.

Thread Safety

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

See Also

Reference

ObjectAnchor Members

DocumentFormat.OpenXml.Spreadsheet Namespace