Altova XMLSpy 2024 Enterprise Edition


Accueil Préc Haut Suivant

Event: OnSelectionChanged (objNewSelection as AuthenticRange)


Scripting environment - VBScript:

Function On_AuthenticSelectionChanged (objNewSelection)

End Function


Scripting environment - JScript:

function On_AuthenticSelectionChanged (objNewSelection)




IDE Plugin:

IXMLSpyPlugIn.OnEvent (23, ...)        // nEventId = 23



This event gets triggered whenever the selection in the user interface changes.



' ----------------------------------------------------------------------------

' VB code snippet - connecting to object level events

' ----------------------------------------------------------------------------

' access XMLSpy (without checking for any errors)

Dim objSpy As XMLSpyLib.Application

Set objSpy = GetObject("", "XMLSpy.Application")


' this is the event callback routine connected to the OnSelectionChanged

' event of object objView

Private Sub objView_OnSelectionChanged (ByVal i_ipNewRange As XMLSpyLib.IAuthenticRange)

   MsgBox ("new selection: " & i_ipNewRange.Text)

End Sub


' use VBA keyword WithEvents to connect to object-level event

Dim WithEvents objView As XMLSpyLib.AuthenticView

Set objView = objSpy.ActiveDocument.AuthenticView


' continue here with something useful ...

' and serve the windows message loop

© 2018-2024 Altova GmbH