• Subject: Trying to open the new mailItem inspector form within a custom Win
  • Author: Naji
  • Date: 09 May
  • References:
Good evening everybody,

I am working on a VST add-in. I am using C#, Outlook 2007 and VS2008

I have a Toolbar button that, when clicked, opens a windows form. This part
works fine. However, what I am having a problem with is trying to,
programmatically, open a new mailItem inspector by clicking on a button that
resides on the windows form.
I need to do it in this fashion to:
1- be able to populate the mailitem properties using the winForm fields
2- avoid recreating all the functionality(attachment,spell check, follow
up, address book, etc ) that is already built into the mail inspector window

My question: is it possible to open a new Message Inspector from withing a
windows form that is part of an Outlook add-in?
If the answer is yes, and I hope so, How would you do it?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is what I have in place so far:

public void CreateNewMail(string subject)
{
Outlook.MailItem mail = null;
Outlook.Application m_Outlook = null;

try
{
m_Outlook = Globals.ThisAddIn.Application;

mail =
(Outlook.MailItem)m_Outlook.CreateItem(Outlook.OlItemType.olMailItem);
mail.Subject = subject;
mail.Display(false);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (mail != null)
Marshal.ReleaseComObject(mail);
}
}


Thank you for your time and effort.
09 MayTrying to open the new mailItem inspector form within a custom Win.Naji
12 May\ Re: Trying to open the new mailItem inspector form within a custom Win.Ken Slovak - [MVP - O...
12 May   \ Re: Trying to open the new mailItem inspector form within a custom.Naji
12 May      \ Re: Trying to open the new mailItem inspector form within a custom.Ken Slovak - [MVP - O...
16 Jun         \ Re: Trying to open the new mailItem inspector form within a custom.Jason Wang
17 Jun            \ Re: Trying to open the new mailItem inspector form within a custom.Ken Slovak - [MVP - O...
All times are in (US) Eastern Daylight Time (GMT -4:00)