Propriedade XmlMappedRange.HorizontalAlignment

Obtém ou define o alinhamento horizontal para o controle de XmlMappedRange .

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (em Microsoft.Office.Tools.Excel.dll)

Sintaxe

'Declaração
Property HorizontalAlignment As Object
Object HorizontalAlignment { get; set; }

Valor de propriedade

Tipo: System.Object
Um dos valores de XlHAlign .

Comentários

Algumas das constantes de XlHAlign podem não estar disponíveis para você, como o suporte a linguagem (inglês.. dos EUA. por exemplo,) que você selecionou ou instalado.

Exemplos

O exemplo de código usa as propriedades de HorizontalAlignment e de VerticalAlignment para alinhar o conteúdo de XmlMappedRange à direita inferior.Este exemplo de código a seguir pressupõe que a planilha atual contiver XmlMappedRange chamado CustomerLastNameCell.

Private Sub AlignBottomRight()
    Me.CustomerLastNameCell.HorizontalAlignment = _
        Excel.XlHAlign.xlHAlignRight
    Me.CustomerLastNameCell.VerticalAlignment = _
        Excel.XlVAlign.xlVAlignBottom
    Me.CustomerLastNameCell.Value2 = "The contents " & _
        "of this cell are aligned to the bottom right."
    Me.CustomerLastNameCell.RowHeight = 100
    Me.CustomerLastNameCell.ColumnWidth = 75
End Sub
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;
}

Segurança do .NET Framework

Consulte também

Referência

XmlMappedRange Interface

Namespace Microsoft.Office.Tools.Excel