Skip to main content

Search

Search

Get Event Name

Comments

1 comment

  • Avatar
    Legacy Poster

    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 Function
    

    On 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

Please sign in to leave a comment.