XmlMappedRange.ClearFormats Méthode

Définition

Efface la mise en forme du contrôle XmlMappedRange.

public object ClearFormats ();

Retours

Object

Exemples

L’exemple de code suivant utilise la <xref:Microsoft.Office.Tools.Excel.XmlMappedRange.BorderAround%2A> méthode pour appliquer une bordure épaisse autour d’un XmlMappedRange . L’exemple invite ensuite l’utilisateur à effacer la bordure à l’aide de la ClearFormats méthode. Cet exemple de code suppose que la feuille de calcul active contient un XmlMappedRange nommé CustomerLastNameCell .

private void SetBorder()
{
    this.CustomerLastNameCell.BorderAround(missing, 
        Excel.XlBorderWeight.xlThick, 
        Excel.XlColorIndex.xlColorIndexAutomatic);

    if (MessageBox.Show("Clear the border?", "Test",
        MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
        this.CustomerLastNameCell.ClearFormats();
    }
}
Private Sub SetBorder()
    Me.CustomerLastNameCell.BorderAround( _
        Weight:=Excel.XlBorderWeight.xlThick, _
        ColorIndex:=Excel.XlColorIndex.xlColorIndexAutomatic)

    If MessageBox.Show("Clear the border?", "Test", MessageBoxButtons.YesNo) = _
        DialogResult.Yes Then
        Me.CustomerLastNameCell.ClearFormats()
    End If
End Sub

S’applique à