Application.EventList プロパティ (Visio)

オブジェクトの EventList コレクション、または Event オブジェクトを含む EventListコレクションを返 します。 読み取り専用です。

構文

EventList

expressionApplication オブジェクトを 表す変数。

戻り値

EventList

この Microsoft Visual Basic for Applications (VBA) マクロは、EventList プロパティを使用して、Event オブジェクトを Document オブジェクトの EventList コレクションに追加します。 ドキュメントに図形を追加することによって Event オブジェクトがトリガーされると、指定した VSL アドオンが実行されます。

このマクロを実行する前に、 への参照をfullpath\filenamefilename、Microsoft Visio VSL または実行可能ファイル (EXE) アドオンの有効なパスと名前に置き換えます。

 
Public Sub EventList_Example() 
 
 Dim vsoEventList As Visio.EventList 
 Dim vsoEvent As Visio.Event 
 Dim vsoAddons As Visio.Addons 
 Dim vsoAddon As Visio.Addon 
 
 'Prevent overflow error. 
 Const visEvtAdd% = &H8000 
 
 'Add the specified add-on to the Addons collection. 
 Set vsoAddons = Visio.Addons 
 Set vsoAddon = vsoAddons.Add ("fullpath\filename") 
 
 'Add a ShapeAdded event to the EventList collection 
 'of the document. The event will start the specified add-on, which 
 'should take no arguments. 
 Set vsoEventList = ThisDocument.EventList 
 Set vsoEvent = vsoEventList.Add(visEvtAdd + visEvtShape, visActCodeRunAddon, _ 
 "filename", "") 
 
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。