none
Outlook2007/2010 to-dor bar programming and access mailitme RRS feed

  • General discussion

  • HI, Expert

    Is there any way to develop a new to-do bar in Outlook2007/2010?

    I have read some reference and the result is VSTO2010 doesn't support it.

    Then I found a Linke http://www.codeproject.com/KB/office/additional_panel_Outlook.aspx?fid=1440828&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26

    It give me some idea,but doesn't look like to-do bar,and it's code will cut Outlook To -do bar.

    Can any one give me some idea about how to develop a new to do bar in Outlook2007/2010?

    And another question, I read some demo to access Outlook.MailItem

    When I use inclue Microsoft.Office.Interop.Outlook 12.0.0.0. This mailItem object can be acces and as a parameter of another function.

    But when I use Microsoft.Office.Interop.Outlook 14.0.0.0. in my project,

    System give me this message:AccessViolationException?How can I fixed it? I just want get information about this mailItem.

     private void ThisAddIn_Startup(object sender, System.EventArgs e)
     {
    
      m_Explorer = this.Application.ActiveExplorer();
      m_Explorer.SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
         }
     void ThisAddIn_SelectionChange()
     {
      if (m_Explorer.Selection.Count == 0)
            return; //No selection has been made
          //Take the first selected item 
          MailItem mailItem = m_Explorer.Selection[1] as MailItem;
          if (mailItem != null)
          {
            // Read read-only attributes of mailItem is OK
            ContactInfo contactInfo1 = new ContactInfo(mailItem.Sender.Name, mailItem.Sender.Address);
         }
    }
    
    Tuesday, March 8, 2011 8:43 AM

All replies

  • You can develop for what's called adjacent windows, but anything would still move over and take room from the other windows in some way or other. Take a look at this article for information on adjacent windows: http://blogs.msdn.com/b/stephen_griffin/archive/2010/06/01/adjacent-windows-in-outlook.aspx
     
    You should have only 1 version of Outlook on your development machine. If you have Outlook 2007 then your dev machine can only use that PIA, although any code you create will also run on Outlook 2010. If you have 2010 installed and use the 2010 PIA you cannot run on 2007 or earlier unless you use Framework 4.
     
    With Framework 4 you can embed the PIA and as long as you don't use anything new or changed from 2010 in your code the code will run on 2007. That's the only exception.
     
    Except for the Framework 4 exception the rule of thumb is to have installed on the dev machine the oldest version of Office you intend to support with that particular project.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Jason li-Shanghai" <=?utf-8?B?SmFzb24gbGktU2hhbmdoYWk=?=> wrote in message news:fac02ea6-e9a0-42c2-997d-744f3bf87abf...

    HI, Expert

    Is there any way to develop a new to-do bar in Outlook2007/2010?

    I have read some reference and the result is VSTO2010 doesn't support it.

    Then I found a Linke http://www.codeproject.com/KB/office/additional_panel_Outlook.aspx?fid=1440828&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26

    It give me some idea,but doesn't look like to-do bar,and it's code will cut Outlook To -do bar.

    Can any one give me some idea about how to develop a new to do bar in Outlook2007/2010?

    And another question, I read some demo to access Outlook.MailItem

    When I use inclue Microsoft.Office.Interop.Outlook 12.0.0.0. This mailItem object can be acces and as a parameter of another function.

    But when I use Microsoft.Office.Interop.Outlook 14.0.0.0. in my project,

    System give me this message:AccessViolationException?How can I fixed it? I just want get information about this mailItem.

     private void ThisAddIn_Startup(object sender, System.EventArgs e)
     {
    
     m_Explorer = this.Application.ActiveExplorer();
     m_Explorer.SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
       }
     void ThisAddIn_SelectionChange()
     {
     if (m_Explorer.Selection.Count == 0)
        return; //No selection has been made
       //Take the first selected item 
       MailItem mailItem = m_Explorer.Selection[1] as MailItem;
       if (mailItem != null)
       {
        // Read read-only attributes of mailItem is OK
        ContactInfo contactInfo1 = new ContactInfo(mailItem.Sender.Name, mailItem.Sender.Address);
       }
    }
    

    Ken Slovak MVP - Outlook
    Tuesday, March 8, 2011 3:07 PM
  • Thank you for your help!
    Jason Li
    Wednesday, March 9, 2011 5:32 AM