共用方式為


XmlMappedRange.ClearFormats Method

Definition

Clears the formatting of the XmlMappedRange control.

public:
 System::Object ^ ClearFormats();
public object ClearFormats ();
abstract member ClearFormats : unit -> obj
Public Function ClearFormats () As Object

Returns

Examples

The following code example uses the <xref:Microsoft.Office.Tools.Excel.XmlMappedRange.BorderAround%2A> method to apply a thick border around an XmlMappedRange. The example then prompts the user to clear the border by using the ClearFormats method. This code example assumes that the current worksheet contains an XmlMappedRange named 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

Applies to