Click here to Skip to main content
11,705,453 members (29,629 online)
Click here to Skip to main content

OeLibrary 1.0

, 22 Aug 2013 GPL3 81.4K 2.1K 55
Rate this:
Please Sign up or sign in to vote.
Opensource Outlook Express automation library

Introduction

OELibrary is open source COM based component written in C++. I have created this component long back when I used to work with EfExtra e-solution pvt ltd. There it used to be closed source, paid software, but due to some personal and professional reason, this component has not able to see light of day. After around three year, when I enquired about the same, Saurabh (Director, EfExtra) happily agreed to launch project open source, rather then just lying idle in backup of computer.

His thinking behind this is that, at least programmer community gets benefited of it and the project might get more robust and feature rich after receiving feedback and working (multiple mind instead of single) . This component is released under GPL license. This component is RELEASE AS IS, without any warranties and guarantees.

This component is dedicated to My Mother Late Mrs. Saroj Gupta.

The Objective

The aim of this project is to create a programming library which enables automating, or in other words, providing programmatic access to certain tasks in Outlook Express.
The central idea is to provide an easy to use object model to developers who wish to interact and control Outlook Express from their applications. Some of the functions this library aims to provide are:

Features

  • Add, Delete, & Enumerate mail folders in Outlook Express.
  • Enumerate, Read, and Delete messages in a given folder.
  • Move messages from one folder to another.
  • Get selected folder.
  • Notifications for certain events (e.g. new mail).
  • Adding a custom toolbar to Outlook Express and responding to click events on it.
  • Reading OEAccount information.
  • Manipulating the Window Address book!

Where it could be used ?

Outlook Express is a free email client and comes preinstalled with Microsoft Windows Operating Systems. Outlook Express is the most commonly used email client today.
Outlook Express does not support automation by itself unlike Microsoft Outlook, which comes as a part of Microsoft’s Office suite. Microsoft Outlook provides a feature rich and easy to use object model allowing developers to automate most tasks in it.


Many developers who want to develop applications/plug-ins/add-ins for Outlook Express can’t do so because of its lack of any automation interface.
The goal of this project is to fill this void and provide a library that can use used by developers to automate Outlook Express from their applications.

The library can be developed as a COM component (ActiveX DLL) that can be referenced by developers in their projects. The ActiveX component will provide a expose an object model similar to the automation interface of Microsoft Outlook. This insures that the developers who have already worked with Microsoft Outlook automation feel at ease working with our Outlook Express Automation Library. The ActiveX DLL will be developed as an ATL COM component so that it does not have any additional dependencies.

Using the code and some example

I am assuming that you already have the reference of EfOeLibrary in your Projects!. object model is quite simple, you just have to create the object of the Application and all thing what ever you want come from it.

1. Getting Inbox folder !

Private Sub Command1_Click()
Dim app As New OELib.Application
Dim inboxFolder, rootFolder As OELib.MailFolder

' CREATE THE OBJECT OF root folder
Set rootFolder = app.GetLocalFolder

' retrieve Inbox special folder
Set inboxFolder = rootFolder.GetSpecialFolder(SF_FOLDER_INBOX)


If inboxFolder Is Nothing Then
 MsgBox " error getting reference of inbox folder"
Else
MsgBox " Yo! man, you recv reference of inbox folder"
End If
End Sub

2. Getting Messages !

Private Sub Command1_Click()
Dim app As New OELib.Application
Dim inboxFolder, rootFolder As OELib.MailFolder
Dim IMsg As MailItem


' CREATE THE OBJECT OF root folder
Set rootFolder = app.GetLocalFolder

' retrieve Inbox special folder
Set inboxFolder = rootFolder.GetSpecialFolder(SF_FOLDER_INBOX)


If inboxFolder Is Nothing Then
 MsgBox " error getting reference of inbox folder"
Else
MsgBox " Yo! man, you recv reference of inbox folder"
End If

' get first message
Set IMsg = inboxFolder.GetFirstMessage

' check weather you recv same of not
If Not IMsg Is Nothing Then
MsgBox IMsg.From
End If


End Sub

3. Creating Toolband

Private Sub Command2_Click()
Dim app As New OELib.Application
Dim ptoolband As OELib.OEToolBand

' get the obejct

Set ptoolband = app.GetToolBand

'add button
ptoolband.AddButton OE_TYPE_BUTTON, "Alok Gupta"

End Sub

4. Reading OeAccount Information!

Private Sub Command3_Click()
Dim app As New OELib.Application
Dim oeacctmgr As OEAccountMgr
Dim oeacct As OEAccount

' get account mgr object
Set oeacctmgr = app.GetOEAccounts


If Not oeacctmgr Is Nothing Then
 ' get news account
  Set oeacct = oeacctmgr.GetFirstAccount(OE_SRV_NNTP)

  If Not oeacct Is Nothing Then
   MsgBox oeacct.AccountName
  End If

End If

End Sub

Object Model...!

1. Folder - Message Object Model :-

EfOelibrary/image10_0.jpg

2. Toolband Object Model :-

EfOelibrary/image10_1.jpg

Installation Guide...!

  • Register Efoexxxx.dll using regsvr32.exe
  • copy efinject.dll and oehook.dll in windows directory

Special Thanks...!

  • My Parents
  • Saurabh Gupta, [Director EfExtra ESolution Pvt. Ltd.]
  • Mumtaz Zaheer for Hook source code
  • My Friends Ankit and Gaurav for there support in white box testing and creating help!
  • Vizacc freeware helpmaker

History

March 2, 2008 :- First Release for OeLibrary 1.0

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

ThatsAlok
Software Developer (Senior)
India India
He used to have biography here Smile | :) , but now he will hire someone (for free offcourse Big Grin | :-D ), Who writes his biography on his behalf Smile | :)

He is Great Fan of Mr. Johan Rosengren (his idol),Lim Bio Liong, Nishant S and DavidCrow and Believes that, he will EXCEL in his life by following there steps!!!


For good 8 years he was Visual CPP MSMVP!

You may also be interested in...

Comments and Discussions

 
QuestionCeate New DBX Pin
john56328-Sep-11 23:05
memberjohn56328-Sep-11 23:05 
Generalfailed to creat toolbar Pin
nikle_li23-Apr-10 20:15
membernikle_li23-Apr-10 20:15 
GeneralRe: failed to creat toolbar Pin
nikle_li23-Apr-10 20:29
membernikle_li23-Apr-10 20:29 
GeneralVS2005/2008 Version Pin
Tomas Mikolanda24-Mar-10 12:29
memberTomas Mikolanda24-Mar-10 12:29 
QuestionMemory leak? Pin
garzooma27-Oct-09 14:53
membergarzooma27-Oct-09 14:53 
AnswerRe: Memory leak? Pin
ThatsAlok15-Sep-11 0:01
memberThatsAlok15-Sep-11 0:01 
Generalcrash when fast user switch Pin
Member 349844322-Sep-09 22:18
memberMember 349844322-Sep-09 22:18 
GeneralGreat article ! Pin
Member 349844318-Aug-09 16:27
memberMember 349844318-Aug-09 16:27 
Questionhow to use this library in C#.NET Pin
sureshwings11-May-09 19:21
membersureshwings11-May-09 19:21 
AnswerRe: how to use this library in C#.NET Pin
ThatsAlok 18-Aug-09 18:03
member ThatsAlok 18-Aug-09 18:03 
QuestionMailItem ReceivedTime property missing? Pin
Sujit D'Mello9-Feb-09 5:54
memberSujit D'Mello9-Feb-09 5:54 
AnswerRe: MailItem ReceivedTime property missing? Pin
ThatsAlok 1-May-09 0:52
member ThatsAlok 1-May-09 0:52 
GeneralThanks very much Pin
David xiao20-Nov-08 15:24
memberDavid xiao20-Nov-08 15:24 
GeneralWAB Support Pin
seniorandre16-Nov-08 10:56
memberseniorandre16-Nov-08 10:56 
QuestionDoes it support Windows Mail ? Pin
salrouge9-Oct-08 6:09
membersalrouge9-Oct-08 6:09 
AnswerRe: Does it support Windows Mail ? Pin
ThatsAlok 9-Oct-08 16:19
member ThatsAlok 9-Oct-08 16:19 
GeneralRe: Does it support Windows Mail ? Pin
salrouge9-Oct-08 23:02
membersalrouge9-Oct-08 23:02 
GeneralRe: Does it support Windows Mail ? Pin
ThatsAlok 9-Oct-08 23:46
member ThatsAlok 9-Oct-08 23:46 
GeneralRe: Does it support Windows Mail ? Pin
ThatsAlok 9-Oct-08 23:52
member ThatsAlok 9-Oct-08 23:52 
GeneralRe: Does it support Windows Mail ? Pin
salrouge11-Oct-08 9:31
membersalrouge11-Oct-08 9:31 
QuestionWABContact???? Pin
bendbock8-Oct-08 14:10
memberbendbock8-Oct-08 14:10 
AnswerRe: WABContact???? Pin
bendbock8-Oct-08 14:35
memberbendbock8-Oct-08 14:35 
GeneralRe: WABContact???? Pin
ThatsAlok 8-Oct-08 15:59
member ThatsAlok 8-Oct-08 15:59 
The dll i have provided is BASE DLL, you have to recompile the code with appropriate compiler option to get your WABCONTACT etc.

My personal suggestion would, extract the code of WAB from library and use it into your app.

"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixture

cheers,
Alok Gupta
VC Forum Q&A :- I/IV
Support CRY- Child Relief and You/xml>

GeneralpInboxFolder_NewMsg Event Not Firing in VBExample NewMessage Project Pin
chaines325-Jun-08 11:37
memberchaines325-Jun-08 11:37 
QuestionRelated to Block sender Pin
pakistan16-Jun-08 2:51
memberpakistan16-Jun-08 2:51 
AnswerRe: Related to Block sender Pin
ThatsAlok 16-Jun-08 5:57
member ThatsAlok 16-Jun-08 5:57 
AnswerRe: Related to Block sender Pin
ThatsAlok 16-Jun-08 5:58
member ThatsAlok 16-Jun-08 5:58 
GeneralRe: Related to Block sender Pin
pakistan16-Jun-08 23:21
memberpakistan16-Jun-08 23:21 
GeneralRe: Related to Block sender Pin
ThatsAlok 17-Jun-08 5:35
member ThatsAlok 17-Jun-08 5:35 
GeneralDoesn't seem to work Pin
joujoukinder8-May-08 7:02
memberjoujoukinder8-May-08 7:02 
QuestionHow can I display mailitem [modified] Pin
chipdori23-Apr-08 21:43
memberchipdori23-Apr-08 21:43 
GeneralSend mail with attacment from MS Access Pin
Pilvio17-Apr-08 2:16
memberPilvio17-Apr-08 2:16 
GeneralRe: Send mail with attacment from MS Access Pin
ThatsAlok 18-Apr-08 2:18
member ThatsAlok 18-Apr-08 2:18 
QuestionRe: Send mail with attacment from MS Access Pin
Pilvio19-Apr-08 23:09
memberPilvio19-Apr-08 23:09 
GeneralRe: Send mail with attacment from MS Access Pin
MWise22-Apr-08 3:45
memberMWise22-Apr-08 3:45 
GeneralRe: Send mail with attacment from MS Access Pin
Pilvio22-Apr-08 20:11
memberPilvio22-Apr-08 20:11 
GeneralRe: Send mail with attacment from MS Access Pin
ThatsAlok 9-Oct-08 23:56
member ThatsAlok 9-Oct-08 23:56 
QuestionWhich Windows Template Library (WTL) is sued in the project? Pin
FanFoolBall17-Mar-08 13:14
memberFanFoolBall17-Mar-08 13:14 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok 17-Mar-08 15:57
member ThatsAlok 17-Mar-08 15:57 
QuestionRe: Which Windows Template Library (WTL) is sued in the project? Pin
FanFoolBall18-Mar-08 6:28
memberFanFoolBall18-Mar-08 6:28 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok18-Mar-08 7:43
member ThatsAlok18-Mar-08 7:43 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
FanFoolBall18-Mar-08 13:16
memberFanFoolBall18-Mar-08 13:16 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok 18-Mar-08 16:31
member ThatsAlok 18-Mar-08 16:31 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
FanFoolBall18-Mar-08 16:37
memberFanFoolBall18-Mar-08 16:37 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok 18-Mar-08 16:50
member ThatsAlok 18-Mar-08 16:50 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
FanFoolBall19-Mar-08 0:47
memberFanFoolBall19-Mar-08 0:47 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok 19-Mar-08 1:42
member ThatsAlok 19-Mar-08 1:42 
GeneralRe: Which Windows Template Library (WTL) is sued in the project? Pin
ThatsAlok 19-Mar-08 3:28
member ThatsAlok 19-Mar-08 3:28 
GeneralThanks Pin
Zhefu Zhang4-Mar-08 13:27
memberZhefu Zhang4-Mar-08 13:27 
GeneralRe: Thanks [modified] Pin
ThatsAlok4-Mar-08 16:20
member ThatsAlok4-Mar-08 16:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150819.1 | Last Updated 22 Aug 2013
Article Copyright 2008 by ThatsAlok
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid