(Temporary)Disable event handlers

M

Markus Kinzler

I created a custom form including an ActiveX-Control.
This form includes a Item_write handler in vbscript.

When I try to modify the item externally ( a COM-AddIn) the event
handler is called and tries to get access to the ActiveX-Control.

Is it possible to disable the event handler during update of the
record through the AddIn.

Tnanks in advance.

Markus Kinzler.
 
R

Rainer Schwenkreis

Hello Markus,

Markus Kinzler said:
I created a custom form including an ActiveX-Control.
This form includes a Item_write handler in vbscript.

When I try to modify the item externally ( a COM-AddIn) the event
handler is called and tries to get access to the ActiveX-Control.

Is it possible to disable the event handler during update of the
record through the AddIn.

Tnanks in advance.

Markus Kinzler.

You can set a global Boolean Variable in Item_Open. If your Item is Modified
by your AddIn Item_Open
is not called.

e.g.

Dim bOpenedAsForm

Sub Item_Open
bOpendAsForm = true
End Sub

Sub Item_Write
if not bOpendAsForm then exit sub

' Your Code here

End Sub
 
M

Markus Kinzler

Hello Rainer,

Thank you for your answer.

I already tried this, but I still can't write back my modifications to
an (appointment)item. I got an EOleSysError ( "Vorgang kann nicht
beendet werden!") when calling Item.Save within the AddIn (if parts of
the appointmentitem has been changed; no difference of standard as
Subject or userdefined properties are changed.)

Markus Kinzler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top