This macro creates an event (#1) that occurs when the string "You're in trouble now!" is received from the host:

Sub CreateStringEvent()

 Session.DefineEvent 1, rcCommString, "You're in trouble now!"

End Sub

This event procedure checks to see if event #1 is the triggering event. If this is the case, it displays a message box with more information.

Private Sub Session_DefinedEvent(ByVal EventNumber As Long, ByVal EventType As Long, ByVal TheString As Variant, ByVal Row As Long, ByVal Column As Long, ByVal Key As Long)

 If EventNumber = 1 Then

  MsgBox "Contact Joe for more information."

 End If

End Sub


· The underscore line continuation character is used to break up long lines of code in this example.