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

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

  • martes, 17 de abril de 2012 9:02
     
     

    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);

Todas las respuestas

  • martes, 17 de abril de 2012 13:43
    Moderador
     
     Respondida
    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
  • jueves, 19 de abril de 2012 12:14
     
     Respondida

    check this link this may help you out

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