Graph.EventCode

Returns/sets the event code of a document.

Syntax Parameters Return/assignment Value
- - String

SVB Example

Adding a document-level event to a graph:

Option Base 1
Option Explicit
Sub Main
    'Whenever the graph is right clicked on,
    'a Henon Strange Attractor will appear
    ActiveGraph.AddEvent(Path & _
        "\Examples\Macros\Graph Examples\Henon Strange Attractor.svb")
    ActiveGraph.EventCode = ActiveGraph.EventCode & vbCrLf & _
        "Private Sub Document_BeforeRightClick(ByVal Where As Long, Cancel As Boolean)" & _
        vbCrLf & "main" & vbCrLf & "End Sub"
    ActiveGraph.RunEvent
End Sub