Art  Delphi  Automation  History  Home  Politics  Email me Default Colours  Printable Colours

Automating Outlook Express

You cannot automate Outlook Express.

That's it. Really. It is impossible to automate Outlook Express. You can automate Outlook, but not OE.

But don't despair quite yet: you may be able to use other techniques to achieve what you want. If you just want to send an email, you can use ShellExecute, or MAPI to send email via the default MAPI client (which may be OE). And if you want to read the Outlook Express *.dbx files, Walther Estergaard has very kindly made his code for doing this available, and you can download it here. Thanks, Walther!

Thanks, too, to Andrew Chapman, who sent the following information:

"OE has two means of customisation and extension. You can alter the registry setting
FrontPagePath to set up a custom "Outlook Express" page like the "Outlook
Today" page in Outlook and you can enable the "infopane" page.

There is a difference in the capabilities of the two pages. The Infopane
has to be a standard IE compatible HTML web page, but the OE page can also
contain custom URI's of the form oecmd:newNewsMessage or oecmd:readMail.
Javascript or vbscript can be used in these pages so you can create a custom
interface into OE.

At the moment the only valid oecmd: commands that I know about are those
used in the default MS OE page, these are:

oecmd:readMail
oecmd:newMessage
oecmd:newNewsMessage
oecmd:newMailAccount
oecmd:newNewsAccount
oecmd:readNews
oecmd:subscribeNews
oecmd:noop
oecmd:findMessage
oecmd:addrBook
oecmd:findAddr
oecmd:switchUser
oecmd:newUser
oecmd:manageUser
oecmd:logoff

You have only one OE page to play with, but this can be as complex as you
like with as much Javascript/vbscript as you can write so you could write an
application around this. In this example, I have rewritten the page to include DHTML and
data islands that display a sortable, filterable directory retreiving XML
data from an SQL data query. This gives users a view of our organisational
address book. Presumably you could make the page dynamic,
using asp, php or Delphi through a http server (perhaps running locally) to
make it even more sophisticated."

How to send email

How to read Outlook Express *.dbx files

 

>>>>>How to send email<<<<<

You can use ShellExecute to send email via the default email client:

uses
  Shellapi;
var
  Command: string;
begin
  Command := 'mailto:dpate@hotmail.com?subject='The subject line'; 
  ShellExecute(0, nil, PChar(Command), nil, nil, SW_SHOWNORMAL);

You can also use MAPI to send email using the default MAPI client, which may be OE.

 

>>>>>How to read Outlook Express *.dbx files<<<<<

Walther Estergaard has parsed the .dbx file format and written a unit which allows you to read these files. It comes with a sample application and an explanatory article, too. Download it now! :)