SmartTagBase.Actions 속성 (2007 시스템)
업데이트: 2007년 11월
스마트 태그에 의해 노출된 작업 배열을 가져오거나 설정합니다.
네임스페이스: Microsoft.Office.Tools
어셈블리: Microsoft.Office.Tools.Common.v9.0(Microsoft.Office.Tools.Common.v9.0.dll)
구문
Public Property Actions As ActionBase()
Dim instance As SmartTagBase
Dim value As ActionBase()
value = instance.Actions
instance.Actions = value
public ActionBase[] Actions { get; set; }
속성 값
형식: array<Microsoft.Office.Tools.ActionBase[]
스마트 태그에 의해 노출된 작업 배열입니다.
예외
예외 | 상황 |
---|---|
InvalidOperationException | 이 속성은 SmartTagCollection에 스마트 태그가 추가된 후에 설정됩니다. |
설명
스마트 태그에 작업을 동적으로 추가하면 문서의 모든 스마트 태그가 다시 로드되기 때문에 배열 크기는 미리 결정되어야 합니다.
예제
다음 코드 예제에서는 Microsoft.Office.Tools.Excel.SmartTag를 만든 다음 Actions 속성에 작업을 추가합니다. 이 코드 예제는 Microsoft.Office.Tools.Excel.Action 클래스에 대해 제공되는 보다 큰 예제의 일부입니다.
이 예제는 문서 수준 사용자 지정을 위한 것입니다.
WithEvents displayAddress As Microsoft.Office.Tools.Excel.Action
Private Sub AddSmartTag()
Dim smartTagDemo As New _
Microsoft.Office.Tools.Excel.SmartTag( _
"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}"))
' Create the action.
displayAddress = New Microsoft.Office.Tools.Excel.Action( _
"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 =
new Microsoft.Office.Tools.Excel.SmartTag(
"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}"));
// Create the action.
displayAddress = new Microsoft.Office.Tools.Excel.Action(
"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);
}
권한
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.