SmartTagBase.Actions Özellik
Alır veya ayarlar akıllı etiketi tarafından sunulan eylemler dizisi.Bu tür veya üyenin yalnızca 2007 Microsoft Office sistemi projelerinde kullanılması amaçlanmaktadır. Akıllı etiketler Office 2010'da kullanılmamaktadır.
.
Ad alanı: Microsoft.Office.Tools
Derleme: Microsoft.Office.Tools.Common (Microsoft.Office.Tools.Common.dll içinde)
Sözdizimi
'Bildirim
Property Actions As ActionBase()
ActionBase[] Actions { get; set; }
Özellik Değeri
Tür: array<Microsoft.Office.Tools.ActionBase[]
Akıllı etiket tarafından sunulan eylemler dizisi.
Özel Durumlar
Exception | Koşul |
---|---|
InvalidOperationException | Bu özellik için akıllı etiket eklendikten sonra ayarlanır bir SmartTagCollection. |
Notlar
Dizinin boyutu dinamik olarak için akıllı etiket eylemleri ekleme tüm akıllı etiketleri yeniden yüklemek için belgede neden olacağından önceden belirlenmiş, olması gerekir.
Örnekler
Aşağıdaki kod örneği oluşturur bir Microsoft.Office.Tools.Excel.SmartTag ve sonra bir eylem için ekler Actions özelliği.Bu kod örneği için sağlanan daha büyük bir örneğin parçasıdır 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);
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen Güvenilen Koddan Kitaplıkları Kullanma.