Worksheet.SmartTags, propriété (System 2007)

Mise à jour : novembre 2007

Obtient un objet Microsoft.Office.Interop.Excel.SmartTags représentant la collection de balises actives pour la feuille de calcul.

Espace de noms :  Microsoft.Office.Tools.Excel
Assembly :  Microsoft.Office.Tools.Excel.v9.0 (dans Microsoft.Office.Tools.Excel.v9.0.dll)

Syntaxe

<BrowsableAttribute(False)> _
Public ReadOnly Property SmartTags As SmartTags

Dim instance As Worksheet
Dim value As SmartTags

value = instance.SmartTags
[BrowsableAttribute(false)]
public SmartTags SmartTags { get; }

Valeur de propriété

Type : Microsoft.Office.Interop.Excel.SmartTags

Un objet Microsoft.Office.Interop.Excel.SmartTags représentant la collection de balises actives pour la feuille de calcul.

Exemples

L'exemple de code suivant ajoute une balise active à un contrôle NamedRange, puis utilise la propriété SmartTags pour afficher le nombre de balises actives sur la feuille de calcul active.

Cet exemple illustre une personnalisation au niveau du document.

Private Sub DisplaySmartTags()
    Dim NamedRange1 As Microsoft.Office.Tools.Excel.NamedRange = _
        Me.Controls.AddNamedRange(Me.Range("A1"), _
        "NamedRange1")

        Globals.ThisWorkbook.SmartTagOptions.EmbedSmartTags = True
        Globals.ThisWorkbook.Application.SmartTagRecognizers.Recognize = True

        NamedRange1.Formula = "MSFT"
        Dim SmartTag1 As Excel.SmartTag = _
            NamedRange1.SmartTags.Add( _
            "urn:schemas-microsoft-com:smarttags#StockTickerSymbol")

        MsgBox("There are " & Me.SmartTags.Count.ToString() & _
            " smart tags in this document.")
End Sub
private void DisplaySmartTags()
{
    Microsoft.Office.Tools.Excel.NamedRange NamedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", missing],
        "NamedRange1");

    Globals.ThisWorkbook.SmartTagOptions.EmbedSmartTags = true;
    Globals.ThisWorkbook.Application.SmartTagRecognizers.Recognize = true;

    NamedRange1.Formula = "MSFT";
    Excel.SmartTag SmartTag1 =
        NamedRange1.SmartTags.Add(
        "urn:schemas-microsoft-com:smarttags#StockTickerSymbol");

    MessageBox.Show("There are " + this.SmartTags.Count.ToString() +
        " smart tags in this document.");
}

Autorisations

Voir aussi

Référence

Worksheet, classe

Membres Worksheet

Microsoft.Office.Tools.Excel, espace de noms