WorkbookBase.VstoSmartTags (Propiedad)

Obtiene la colección Microsoft.Office.Tools.SmartTagCollection asociada con el libro.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel.v4.0.Utilities (en Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public ReadOnly Property VstoSmartTags As SmartTagCollection
    Get
public SmartTagCollection VstoSmartTags { get; }

Valor de propiedad

Tipo: Microsoft.Office.Tools.SmartTagCollection
Colección Microsoft.Office.Tools.SmartTagCollection asociada con el libro.

Ejemplos

El ejemplo de código siguiente crea una etiqueta inteligente que establece en azul el color de fuente de una celda cuando se reconoce el término "blue". El ejemplo agrega la etiqueta inteligente al libro utilizando la propiedad VstoSmartTags.

Se trata de un ejemplo para una personalización en el nivel del documento.

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

Private Sub AddSmartTag()
    Dim ColorTag As Microsoft.Office.Tools.Excel.SmartTag = _
        Globals.Factory.CreateSmartTag( _
        "www.contoso.com/Demo#DemoSmartTag", "Demo Smart Tag")

    Dim ColorText As Microsoft.Office.Tools.Excel.Action = _
        Globals.Factory.CreateAction("Color text blue")
    AddHandler ColorText.Click, AddressOf ColorText_Click

    ColorTag.Actions = _
        New Microsoft.Office.Tools.Excel.Action() {ColorText}
    ColorTag.Terms.Add("blue")
    Me.VstoSmartTags.Add(ColorTag)
End Sub

Private Sub ColorText_Click(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Excel.ActionEventArgs)
    e.Range.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue)
End Sub
private void AddSmartTag()
{
    Microsoft.Office.Tools.Excel.SmartTag colorTag =
        Globals.Factory.CreateSmartTag(
        "www.contoso.com/Demo#DemoSmartTag", "Demo Smart Tag");

    Microsoft.Office.Tools.Excel.Action colorText =
        Globals.Factory.CreateAction("Color text blue");
    colorText.Click +=
        new Microsoft.Office.Tools.Excel.ActionClickEventHandler(
        colorText_Click);

    colorTag.Actions =
        new Microsoft.Office.Tools.Excel.Action[] { colorText };
    colorTag.Terms.Add("blue");
    this.VstoSmartTags.Add(colorTag);
}

private void colorText_Click(object sender,
    Microsoft.Office.Tools.Excel.ActionEventArgs e)
{
    e.Range.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue);
}

Seguridad de .NET Framework

Vea también

Referencia

WorkbookBase Clase

Microsoft.Office.Tools.Excel (Espacio de nombres)