Aracılığıyla paylaş


SmartTagBase.Actions Özellik

Alır veya ayarlar tarafından akıllı etiket sergilenen 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 sergilenen eylemler dizisi.

Özel Durumlar

Exception Koşul
InvalidOperationException

Akıllı etiket için eklendikten sonra bu özelliği ayarlanmış bir SmartTagCollection.

Notlar

Akıllı etiket eylemleri dinamik olarak eklemek tüm Akıllı etiketleri yeniden yüklemek için belgede neden olacağından dizinin boyutuna, önceden belirlenmiş, olmalıdır.

Örnekler

Aşağıdaki kod örneği oluşturur bir Microsoft.Office.Tools.Excel.SmartTag ve bir eylem ekler Actions özelliği.Bu kod örneği için sağlanan büyük bir örnek bir 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

Ayrıca bkz.

Başvuru

SmartTagBase Arabirim

Microsoft.Office.Tools Ad Alanı