Create OlItemType.olMailItem via Redemption

J

j

Hi,

WinXP SP2, Outlook 2003, .NET 2.0 C#.


I have win application that one of it feature is open mailItem window
( inspector ).
Currently i do the next:

Microsoft.Office.Interop.Outlook.Application app = new
Microsoft.Office.Interop.Outlook.Application();

MailItem mItem =
(MailItem)app.OutlookInstance.CreateItem(OlItemType.olMailItem);
mItem.Subject = "bla bla bla";
.............
...........

mailItem.Display(false);

In case Outlook isn't running it's automatically starts and after
pressing the Send button on the inspector the process closed.
The snippet above works pretty good.

My question is how can i do the same but via Redemption and not using
OOM at all.

Outlook will be installed but not sure if it will be running when user
will click to write mail.


Thank you.
 
D

Dmitry Streblechenko

Even if Outlook is not running, that code should still work fine.
If you want Redemption with no OOM, try something like the following:

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Drafts = Session.GetDefaultFolder(olFolderDrafts)
set Msg = Drafts.Items.Add
Msg.Subject = "test"
Msg.Display(true)

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top