WorksheetBase.SmartTags (Propiedad)
Obtiene un objeto Microsoft.Office.Interop.Excel.SmartTags que representa la colección de etiquetas inteligentes de la hoja de cálculo.
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 SmartTags As SmartTags
Get
public SmartTags SmartTags { get; }
Valor de propiedad
Tipo: Microsoft.Office.Interop.Excel.SmartTags
Objeto Microsoft.Office.Interop.Excel.SmartTags que representa la colección de etiquetas inteligentes de la hoja de cálculo.
Ejemplos
El ejemplo de código siguiente agrega una etiqueta inteligente a un control NamedRange y, a continuación, utiliza la propiedad SmartTags para mostrar el número de etiquetas inteligentes de la hoja de cálculo actual.
Se trata de un ejemplo para una personalización en el nivel del documento.
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.");
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.