[]
Specifies the horizontal anchor for the text frame in a shape.
Use this enum with HorizontalAnchor to control how a shape's text frame is positioned horizontally within the shape. To control the horizontal alignment of the text itself, use TextAlignment instead.
public enum HorizontalAnchor
Public Enum HorizontalAnchor
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 10, 10, 120, 60);
ITextFrame textFrame = shape.TextFrame;
textFrame.TextRange.Text = "Hello";
textFrame.HorizontalAnchor = HorizontalAnchor.Center;
| Name | Description |
|---|---|
| Center | Text is centered horizontally. |
| None | No alignment. |