Create OlItemType.olMailItem via Redemption

  • Thread starter Thread starter j
  • Start date Start date
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.
 
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
-
 
Back
Top