Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

XmlMappedRange.HorizontalAlignment Property

Gets or sets the horizontal alignment for the XmlMappedRange control.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public Object HorizontalAlignment { get; set; }

Property Value

One of the XlHAlign values.

Some of the XlHAlign constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

The following code example uses the HorizontalAlignment and VerticalAlignment properties to align the contents of XmlMappedRange to the bottom right. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

private void AlignBottomRight()
{
    this.CustomerLastNameCell.HorizontalAlignment = 
        Excel.XlHAlign.xlHAlignRight;
    this.CustomerLastNameCell.VerticalAlignment =
        Excel.XlVAlign.xlVAlignBottom;
    
    this.CustomerLastNameCell.Value2 = "The contents " +
        "of this cell are aligned to the bottom right.";
    this.CustomerLastNameCell.RowHeight = 100;
    this.CustomerLastNameCell.ColumnWidth = 75;
}

Show:
© 2015 Microsoft