Get Event Name
Hello
We want the same script on various objects that behave differently depending on the type of event at the location.
The question is how we get the name of the event running or the Linked Control name.
-
I think you are looking at it from a wrong perspective. The question you should ask is how to know which event is triggered.
I would suggest making the script a global function under the functions and subs tab and call the function in each event with different parameters being send with it depending on the event and object. Basicly you are "catching" the event.
So for instance it would look something like this:
Function and subs tab:
Function catchEvent (eventName, objectName) Select Case eventName Case "onPrintStart" 'execute function a(objectName)' Case "onOpen" 'execute function b(objectName)' End Select End Function Function a(objectName) 'Do something with the object' End Function Function b(objectName) 'Do something with the object' End FunctionOn the onPrintStart event for example you would include this code to trigger the function:
Result = catchEvent("onPrintStart", "nameOfObject")Hope this helps you out.
Regards
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar