0
how to add EventListener in VB.NET
New Here
,
/t5/indesign-discussions/how-to-add-eventlistener-in-vb-net/td-p/1084776
Aug 04, 2008
Aug 04, 2008
Copy link to clipboard
Copied
I want to use Pure VB.NET Code to handle the InDesign events through the ComObject.
I found the EventListener.Add function. However, I don't know how to use it.
Anyone can tell me? thx
I found the EventListener.Add function. However, I don't know how to use it.
Anyone can tell me? thx
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/indesign-discussions/how-to-add-eventlistener-in-vb-net/m-p/1084777#M275298
Aug 04, 2008
Aug 04, 2008
Copy link to clipboard
Copied
Hi AhWa,
Have you tried the scripting documentation? It's at the InDesign scripting home page, which is listed at the top of this forum. The chapter on working with events should answer your question.
You can add your event listener using VB.NET, but you'll probably have to call a VBScript or JavaScript on disk as the event handler.
Thanks,
Ole
Have you tried the scripting documentation? It's at the InDesign scripting home page, which is listed at the top of this forum. The chapter on working with events should answer your question.
You can add your event listener using VB.NET, but you'll probably have to call a VBScript or JavaScript on disk as the event handler.
Thanks,
Ole
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_AhWa_
AUTHOR
New Here
,
/t5/indesign-discussions/how-to-add-eventlistener-in-vb-net/m-p/1084778#M275299
Aug 04, 2008
Aug 04, 2008
Copy link to clipboard
Copied
Hi Ole,
I had read the scripting document. and try to port the VBScript codes to be VB.Net Codes. However, EventListener.Add() required a Object
type handler. So that I have no idea about what should I pass such type for this parameter.
I wounder, Is it possible that a pure VB.Net coded Application driving the Indesign DOM Object with event handler?
Really don't want to deal with the C++.
Thanks,
I had read the scripting document. and try to port the VBScript codes to be VB.Net Codes. However, EventListener.Add() required a Object
type handler. So that I have no idea about what should I pass such type for this parameter.
I wounder, Is it possible that a pure VB.Net coded Application driving the Indesign DOM Object with event handler?
Really don't want to deal with the C++.
Thanks,
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/indesign-discussions/how-to-add-eventlistener-in-vb-net/m-p/1084779#M275300
Aug 04, 2008
Aug 04, 2008
Copy link to clipboard
Copied
Hi AhWa,
Here's the template for the EventListeners.Add method:
Function Add(EventType As String, Handler, [Captures As Boolean = False]) As EventListener
The qualifying event strings for the EventType parameter are shown in the documentation. The Handler parameter is a reference to a file--a VBScript file on disk. The event will pass parameters to this file when it triggers.
As I said, I don't think you can have a "pure" VB.NET application that works with events.
You're welcome to try the C++ API (which doesn't work with events in the same way at all), but I think you'd be better off using VBScripts for the event handlers.
Thanks,
Ole
Here's the template for the EventListeners.Add method:
Function Add(EventType As String, Handler, [Captures As Boolean = False]) As EventListener
The qualifying event strings for the EventType parameter are shown in the documentation. The Handler parameter is a reference to a file--a VBScript file on disk. The event will pass parameters to this file when it triggers.
As I said, I don't think you can have a "pure" VB.NET application that works with events.
You're welcome to try the C++ API (which doesn't work with events in the same way at all), but I think you'd be better off using VBScripts for the event handlers.
Thanks,
Ole
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_AhWa_
AUTHOR
New Here
,
LATEST
/t5/indesign-discussions/how-to-add-eventlistener-in-vb-net/m-p/1084780#M275301
Aug 05, 2008
Aug 05, 2008
Copy link to clipboard
Copied
Thank you Ole,
Finally, I give out the "pure" VB.NET approach and move to pure C++ approach. The Scripting API did not provide sufficient event for my project.
Finally, I give out the "pure" VB.NET approach and move to pure C++ approach. The Scripting API did not provide sufficient event for my project.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

