Handling Delete event in Outlook!

B

Bhavtosh

I want to write a program that shld copy the .msg file to
a location in a system before outlook deletes the
message. any help on this issue wud of help.
 
M

Michael Bauer

Hi Bhavtosh,

what do you mean by "Outlook deletes the message"? Why deletes OL the
message? If it happens because you´re clicking a button, then you could
be able to track the button_click event.
 
B

bhavtosh sharma

i dont want to do it by creating an addin for outlook and write the code
for buton_click event. Is it possible to write a service that runs in
background and copies the mesage deleted by user to some location in the
machine? any url or sample code wud help to start.

-bhavtosh



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

David C. Holley

I believe that he's refering to when the user deletes a message.

Bhavtosh,
I belive that it is possible, but have never delved into it - although I
will soon. I would look around to see if the onDelete event exists and
if so, build a sub triggered by that event.

David H
 
M

Michael Bauer

Hi bhavtosh,

you could track every click on a menu button and every item, that moves
into the DeletedFolder. But you can´t track hard deletes, i.e.
Shift+Remove, with OL methods. For that you probably would need
subclassing methods and catch at least the Shift+Remove key strokes
before they would be handled by OL.
 
B

bhavtosh sharma

im new to programming and have never code anything for outlook. do u
have any link/sample code?

thanx
bhavtosh



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
M

Michael Bauer

Hi Bhavtosh,

not read, just googled for "subclassing vb" returns, among others, this
link:
http://www.vb-helper.com/tutorial_subclassing.html

And here are some links for building a nt-service (none of them I´ve
myself looked at, too):

INFO: Running Visual Basic Applications as Windows NT Services
http://support.microsoft.com/?scid=kb;en-us;175948

HOWTO: Use NTSVC.OCX from Visual Basic
http://support.microsoft.com/?scid=kb;en-us;170883

Sample: http://vbnet.mvps.org/files/resources/ntsrvocx.zip

HOWTO: Create a User-Defined Service
Microsoft Knowledge Base Article - 137890
http://support.microsoft.com/?scid=137890

In addition: Outlook is not suited for running as a service! In general,
any application with a user interface isn´t.
 
Top