none
Error Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(myOlExp_SelectionChange); RRS feed

  • Question

  • Hi, I'm trying to do an addin in

    Visual Studio 2010 + Microsoft Office 2007

    its working, catching outlook user events to MyAddin

     Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler((myOlExp_SelectionChange);

     

     

    in Visual Studio 2010 + Microsoft Office 2010

    ERROR, trying the equivalent code: ExplorerEvents_11_SelectionChangeEventHandler doen´t existe

      Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(myOlExp_SelectionChange);

    Tuesday, April 17, 2012 9:02 AM

Answers

  • This works in Outlook 2003, 2007 and 2010:
     

    ((Outlook.ExplorerEvents_Event)_explorer).SelectionChange += new Outlook.ExplorerEvents_SelectionChangeEventHandler(Explorer_SelectionChange);

    You should get an Explorer object from ActiveExplorer() and not assume that there is an Explorer active. Test that it's not null before using the object, or test for Explorers.Count > 0 and if so use Explorers[1].


    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Vasco_G" <=?utf-8?B?VmFzY29fRw==?=> wrote in message news:a8f6cad9-e178-448b-872b-3603b9df74be...

    Hi, I'm trying to do an addin in

    Visual Studio 2010 + Microsoft Office 2007

    its working, catching outlook user events to MyAddin

     Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler((myOlExp_SelectionChange);

     

     

    in Visual Studio 2010 + Microsoft Office 2010

    ERROR, trying the equivalent code: ExplorerEvents_11_SelectionChangeEventHandler doen´t existe

      Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(myOlExp_SelectionChange);


    Ken Slovak MVP - Outlook
    Tuesday, April 17, 2012 1:43 PM
    Moderator
  • check this link this may help you out

    http://www.mofeel.net/170-microsoft-public-office-developer-outlook-vba/2038.aspx

    Thursday, April 19, 2012 12:14 PM

All replies

  • This works in Outlook 2003, 2007 and 2010:
     

    ((Outlook.ExplorerEvents_Event)_explorer).SelectionChange += new Outlook.ExplorerEvents_SelectionChangeEventHandler(Explorer_SelectionChange);

    You should get an Explorer object from ActiveExplorer() and not assume that there is an Explorer active. Test that it's not null before using the object, or test for Explorers.Count > 0 and if so use Explorers[1].


    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Vasco_G" <=?utf-8?B?VmFzY29fRw==?=> wrote in message news:a8f6cad9-e178-448b-872b-3603b9df74be...

    Hi, I'm trying to do an addin in

    Visual Studio 2010 + Microsoft Office 2007

    its working, catching outlook user events to MyAddin

     Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler((myOlExp_SelectionChange);

     

     

    in Visual Studio 2010 + Microsoft Office 2010

    ERROR, trying the equivalent code: ExplorerEvents_11_SelectionChangeEventHandler doen´t existe

      Application.ActiveExplorer().SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(myOlExp_SelectionChange);


    Ken Slovak MVP - Outlook
    Tuesday, April 17, 2012 1:43 PM
    Moderator
  • check this link this may help you out

    http://www.mofeel.net/170-microsoft-public-office-developer-outlook-vba/2038.aspx

    Thursday, April 19, 2012 12:14 PM