How to declare MAPI Session and Application in Windows Service?

Afroze3

New member
Joined
Sep 13, 2007
Messages
3
Programming Experience
1-3
hi all

i had made exe file that reads an email application. i want to do the same work by windows service, when i copied my codes to windows service project. it says the session object is not created, the error is in the line

Session = CreateObject("MAPI.Session") ' we use a session object of MAPI Component
Session.Logon(ProfileName:="OutLook", ProfilePassword:="*******")
Application = CreateObject("Outlook.Application")
in the above line it says Session and Application is not declared.
Can any one know how to overcome this Error or problem? do i have to add any reference to the windows service application.

i had reference two dlls in my windows service.

the same program i had written in Windows application it is working well.

or
can i execute exe file from windows service. if so could any one tell how to proceed?

please help or post the code(if you have) it will be more helpfull to me

waiting for reply
Regards
Oersla Afroze Ahmed
 
You can also use the object types from the referenced Outlook library:
VB.NET:
Dim Session As MAPI.Session
 
Back
Top