Specifies horizontal alignment of a floating shape, text frame or floating table.
[Visual Basic]
Public Enum HorizontalAlignment
[C#]public enum HorizontalAlignment
Remarks
Example
Shows how to insert a floating image in the middle of a page.
[C#]
// This creates a builder and also an empty document inside the builder.
DocumentBuilder builder = new DocumentBuilder();
// By default, the image is inline.
Shape shape = builder.InsertImage(MyDir + "Aspose.Words.gif");
// Make the image float, put it behind text and center on the page.
shape.WrapType = WrapType.None;
shape.BehindText = true;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.HorizontalAlignment = HorizontalAlignment.Center;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
shape.VerticalAlignment = VerticalAlignment.Center;
builder.Document.Save(MyDir + "Image.CreateFloatingPageCenter Out.doc");
[Visual Basic]
' This creates a builder and also an empty document inside the builder.
Dim builder As DocumentBuilder = New DocumentBuilder()
' By default, the image is inline.
Dim shape As Shape = builder.InsertImage(MyDir & "Aspose.Words.gif")
' Make the image float, put it behind text and center on the page.
shape.WrapType = WrapType.None
shape.BehindText = True
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page
shape.HorizontalAlignment = HorizontalAlignment.Center
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page
shape.VerticalAlignment = VerticalAlignment.Center
builder.Document.Save(MyDir & "Image.CreateFloatingPageCenter Out.doc")
Members
| Member Name | Description | Value |
| None | The object is explicitly positioned, usually using its Left property. | 0 |
| Default | Same as None. | 0 |
| Left | Specifies that the object shall be left aligned to the horizontal alignment base. | 1 |
| Center | Specifies that the object shall be centered with respect to the horizontal alignment base. | 2 |
| Right | Specifies that the object shall be right aligned to the horizontal alignment base. | 3 |
| Inside | Specifies that the object shall be inside of the horizontal alignment base. | 4 |
| Outside | Specifies that the object shall be outside of the horizontal alignment base. | 5 |
Requirements
Namespace: Aspose.Words.Drawing
Assembly: Aspose.Words (in Aspose.Words.dll)
See Also
Aspose.Words.Drawing Namespace | HorizontalAlignment