This documentation is archived and is not being maintained.

Workbook.VstoSmartTags Property

Gets the Microsoft.Office.Tools.SmartTagCollection associated with the workbook.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public SmartTagCollection VstoSmartTags { get; }

Property Value

The Microsoft.Office.Tools.SmartTagCollection associated with the workbook.

The following code example creates a smart tag that sets the font color of a cell to blue when the term "blue" is recognized. The example adds the smart tag to the workbook by using the VstoSmartTags property.

private void AddSmartTag()
    Microsoft.Office.Tools.Excel.SmartTag colorTag = 
        new Microsoft.Office.Tools.Excel.SmartTag(
        "", "Demo Smart Tag");

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

    colorTag.Actions = 
        new Microsoft.Office.Tools.Excel.Action[] {colorText};

public void colorText_Click(object sender,
    Microsoft.Office.Tools.Excel.ActionEventArgs e)
    e.Range.Font.Color = ColorTranslator.ToOle(Color.Blue);