Solved

Catching MS Outlook events

Posted on 2000-03-30
19
390 Views
Last Modified: 2010-04-04
I want to be able to capture MS Outlook events such as e-mail arrival, appointments, etc. using Delphi 5.  Does anyone have any links to good resources or components that I could look at?

BTW, I'm kinda new at Delphi, please keep that in mind...
 
Thanks,
Uy Hoang
0
Comment
Question by:uhoang
  • 7
  • 6
  • 3
  • +1
19 Comments
 
LVL 1

Expert Comment

by:snoop_doggy_dogg
ID: 2669796
Yeah dude!  You can use the EventSinkImp utility that ships with Delphi 5 to create a unit that will allow you to connect to Outlook (or any other automation server with events) from within your Delphi app or Delphi Add-in.

It's simple once you get the hang of it.

Woof!
http://www.woofwoofwoof.com
0
 

Author Comment

by:uhoang
ID: 2669876
Thanks.  Do you have any sample code or documentation that I could look at?
0
 
LVL 1

Expert Comment

by:snoop_doggy_dogg
ID: 2670111
Yes I do, but it'll have to wait until tonight.  I will post it when I get to my other office.

Woof!
http://www.woofwoofwoof.com
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2670156
Some demo's (including outlook) can be found here:

http://www.techvanguards.com/products/eventsinkimp/
0
 

Author Comment

by:uhoang
ID: 2670669
I used the EventSinkImp to create Sink Interfaces for the Microsoft Outlook 98 Object Model, but it gives me errors whenever I try to compile the OutlookEvents.pas file.  What gives?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2670842
It works just fine here....
0
 
LVL 1

Expert Comment

by:snoop_doggy_dogg
ID: 2671319
What are the errors?

Woof!
http://www.woofwoofwoof.com
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2671332
Did you install the component?
0
 
LVL 2

Expert Comment

by:florisb
ID: 2672461
that eventsink tool is made by Binh Ly. He moved his site to: http://www.intac.com/~bly/com/index.htm

I you have problems, try to contact him, he's very helpfull and knows much.

Floris.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:florisb
ID: 2672478
He, click on Eventsink there, and you'll see a downloadable demo for outlook98!?!?!

By the by, you can also do things yourself, I post some code that loops Outlook's folder's and add's events to all folders... ...some comments are in dutch

function TForm1.loopFoldersForEvents(MyNameSpace: olevariant;MyNameSpaceF: _Folders;diepte:integer): boolean;
//loop all folders (also depth), give them all eventhandler
var
  i,j : integer;
  MyNameCount, tempFolder,checkFolder : olevariant;
  tmpFolder: TOutlook9folders;
  tempMyNameSpaceF,F : _Folders;
begin
MyNameCount := MyNameSpace.Folders;
if MyNameCount.count > 0 then
  begin
//  tempMyNameSpaceF := MyNameSpaceF;
  for i := 1 to MyNameCount.Count do
    begin
    ///functie begint op root, item(i).folder -> 1 dieper.
    tempMyNameSpaceF := MyNameSpaceF.item(i).folders;
    tempFolder := MyNameSpace.Folders(i);
///event handlers:
     tmpFolder := TOutlook9folders.Create(Outlook9Application2);
     tmpFolder.ConnectTo(tempMyNameSpaceF);
     tmpFolder.OnFolderAdd := Outlook9Folders2FolderAdd;
     tmpFolder.OnFolderChange := Outlook9Folders2FolderChange;
     tmpFolder.OnFolderRemove := Outlook9Folders2FolderRemove;
//volgende regel zorgt ervoor dat add-event niet meer werkt, ook zonder @.
//     FolderList.add(@tmpFolder);
///....rest....
    checkFolder := tempFolder.Folders;
    ///roep als er subfolders zijn deze functie aan met deze subfolder
    if checkFolder.Count > 0 then
        begin
        loopFoldersForEvents(tempFolder,tempMyNameSpaceF,diepte+1);
        end;
    end;
  end;
result := true;
end;


event procedure like:
procedure TForm1.Outlook9Folders2FolderRemove(Sender: TObject);
begin
showMessage('folder removed');
end;

By the by; we had some problems detecting Outlook quit events. And for the Outlook start event, I implemented a hook.

Floris.




0
 
LVL 2

Expert Comment

by:florisb
ID: 2672502
epsylon, I see I posted a link you posted allready....;-(
0
 

Author Comment

by:uhoang
ID: 2673682
It's a ton of compilation errors.  I'm pretty new to Delphi.  I don't mind error checking my own code, but it's tough doing it on someone else's when you're just starting off.

Would you guys be willing for me to e-mail you the "OutlookEvents.pas" filing so you can take a look?
0
 

Author Comment

by:uhoang
ID: 2673697
In my last comment, I meant "file" not "filing" :)
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 2673926
Hi, why e-mail the "OutlookEvents.pas" file? I have it here already and it gives no errors.

I think you didn't install the "OutlookEvents.pas" as a component. To do that go to the Component menu > Install Component, browse for the "OutlookEvents.pas" file and click 'Ok'. When asked to rebuild, click 'Yes'.

Now you can load the demo project and compile...
0
 

Author Comment

by:uhoang
ID: 2674001
No, I did all that and I got a bunch of compiling errors.  Take a look:

http://www.wam.umd.edu/~uhoang/OutlookEventsErrors.txt
0
 

Author Comment

by:uhoang
ID: 2674205
No, I did all that and I got a bunch of compiling errors.  Take a look:

http://www.wam.umd.edu/~uhoang/OutlookEventsErrors.txt
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2681558
I have no idea why you get these errors.....
0
 

Author Comment

by:uhoang
ID: 2683764
I wrote to Binh Ly, the author, and was able to figure out that I had an older version.  I downloaded the newest one and was able to compile :)
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2684716
Does it answer your question?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 135
Working this component WebCopy with proxy, help 3 76
Simple Delphi Question 9 83
Firemonkey android show image from resource ? 1 32
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now