XmlMappedRange.FormatConditions Property (2007 System)

Gets a FormatConditions collection that represents all the conditional formats for the XmlMappedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property FormatConditions As FormatConditions
'Usage
Dim instance As XmlMappedRange 
Dim value As FormatConditions 

value = instance.FormatConditions
[BrowsableAttribute(false)]
public FormatConditions FormatConditions { get; }
[BrowsableAttribute(false)]
public:
property FormatConditions^ FormatConditions {
    FormatConditions^ get ();
}
public function get FormatConditions () : FormatConditions

Property Value

Type: FormatConditions
A FormatConditions collection that represents all the conditional formats for the XmlMappedRange control.

Examples

The following code example uses the FormatConditions property to alter the font of an XmlMappedRange if the value of the XmlMappedRange is less than the value of cell A1. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerZipCell.

Private Sub ModifyFormatConditions()
    Me.Range("A1").Value2 = 99000
    Me.CustomerZipCell.Value2 = 98052

    ' Set conditional formatting to alter the font and interior pattern if  
    ' the CustomerZipCell value is less than the value in A1. 
    Dim condition1 As Excel.FormatCondition = _
        Me.CustomerZipCell.FormatConditions.Add( _
            Excel.XlFormatConditionType.xlCellValue, _
            Excel.XlFormatConditionOperator.xlLess, "=$a$1")

    condition1.Font.Bold = True
    condition1.Font.Color = &HFF00
End Sub
private void ModifyFormatConditions()
{
    this.Range["A1", missing].Value2 = 99000;
    this.CustomerZipCell.Value2 = 98052;

    // Set conditional formatting to alter the font and interior pattern if  
    // the CustomerZipCell value is less than the value in A1.
    Excel.FormatCondition condition1 = 
        (Excel.FormatCondition)this.CustomerZipCell.FormatConditions.Add(
        Excel.XlFormatConditionType.xlCellValue,
        Excel.XlFormatConditionOperator.xlLess, "=$a$1", missing, missing, missing, missing, missing);

    condition1.Font.Bold = true;
    condition1.Font.Color = 0xFF00;
}

.NET Framework Security

See Also

Reference

XmlMappedRange Class

XmlMappedRange Members

Microsoft.Office.Tools.Excel Namespace