Solved

Catching MS Outlook events

Posted on 2000-03-30
19
401 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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