Propriedade SmartTagBase.Terms

Obtém a coleção de literais de cadeia de caracteres que a marca inteligente reconhecerá.Esse tipo ou membro está destinado a uso apenas em projetos do sistema Microsoft Office 2007. Marcas inteligentes estão preteridas no Office 2010.
.

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

Sintaxe

'Declaração
ReadOnly Property Terms As StringCollection
StringCollection Terms { get; }

Valor de propriedade

Tipo: System.Collections.Specialized.StringCollection
Obtém StringCollection que contém os literais de cadeia de caracteres que a marca inteligente reconhecerá.

Comentários

Use o método de Add para adicionar um literal de cadeia de caracteres ao conjunto de condições que a marca inteligente reconhecerá.

Exemplos

O exemplo de código a seguir cria Microsoft.Office.Tools.Excel.SmartTag e use a propriedade de Terms para adicionar a palavra “venda” à coleção dos termos que a marca inteligente reconhece.Este exemplo de código é parte de um exemplo maior fornecido para Microsoft.Office.Tools.Excel.Action.

WithEvents displayAddress As Microsoft.Office.Tools.Excel.Action

Private Sub AddSmartTag()

    Dim smartTagDemo As Microsoft.Office.Tools.Excel.SmartTag = _
        Globals.Factory.CreateSmartTag(
        "www.microsoft.com/Demo#DemoSmartTag",
        "Demonstration Smart Tag")

    ' Specify a term and an expression to recognize.
    smartTagDemo.Terms.Add("sale")
    smartTagDemo.Expressions.Add( _
        New System.Text.RegularExpressions.Regex( _
        "[I|i]ssue\s\d{5,6}"))

    displayAddress = Globals.Factory.CreateAction("To be replaced")

    ' Add the action to the smart tag.
    smartTagDemo.Actions = New Microsoft.Office.Tools.Excel.Action() { _
            displayAddress}

    ' Add the smart tag.
    Me.VstoSmartTags.Add(smartTagDemo)
End Sub
private Microsoft.Office.Tools.Excel.Action displayAddress;

private void AddSmartTag()
{
    Microsoft.Office.Tools.Excel.SmartTag smartTagDemo =
        Globals.Factory.CreateSmartTag(
            "www.microsoft.com/Demo#DemoSmartTag",
            "Demonstration Smart Tag");

    // Specify a term and an expression to recognize.
    smartTagDemo.Terms.Add("sale");
    smartTagDemo.Expressions.Add(
        new System.Text.RegularExpressions.Regex(
        @"[I|i]ssue\s\d{5,6}"));

    displayAddress = Globals.Factory.CreateAction("To be replaced");


    // Add the action to the smart tag.
    smartTagDemo.Actions = new Microsoft.Office.Tools.Excel.Action[] { 
        displayAddress };

    // Add the smart tag.
    this.VstoSmartTags.Add(smartTagDemo);

    displayAddress.BeforeCaptionShow += new 
        Microsoft.Office.Tools.Excel.BeforeCaptionShowEventHandler(
        DisplayAddress_BeforeCaptionShow);

    displayAddress.Click += new 
        Microsoft.Office.Tools.Excel.ActionClickEventHandler(
        DisplayAddress_Click);
}

Segurança do .NET Framework

Consulte também

Referência

SmartTagBase Interface

Namespace Microsoft.Office.Tools