Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Create OlItemType.olMailItem via Redemption

Geek News

Create OlItemType.olMailItem via Redemption
j <Evgeny.Br[ at ]gmail.com> 10/25/2008 2:27:06 PM

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.
Re: Create OlItemType.olMailItem via Redemption
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 10/26/2008 8:22:34 PM
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
-
"j" <Evgeny.Br[ at ]gmail.com> wrote in message
news:172e358d-8319-45ff-b1d6-4642e7083297[ at ]k16g2000hsf.googlegroups.com...
[Quoted Text]
>
> 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.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net