none
Outlook 2010 Folder BeforeItemMove event did not tigger from open mail item RRS feed

  • Question

  • Hello,

    I'm working with a VSTO addin in VS2010, Outlook 2010 SP1 (14.0.6112.5000 32bits) and W7.

    I need to catch the move item event, so I created a class member Outlook.Folder object and handle the event "BeforeItemMove":

    .....
    Protected WithEvents m_olFolderInbox As Outlook.Folder 
    .....
        Private Sub m_olExplorer_FolderSwitch() Handles m_olExplorer.FolderSwitch
            If m_olFolderInbox Is Nothing Then
                m_olFolderInbox = m_olOutlook.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
            End If
        End Sub
    .....
        Private Sub m_olFolderInbox_BeforeItemMove(Item As Object, MoveTo As Microsoft.Office.Interop.Outlook.MAPIFolder, ByRef Cancel As Boolean) Handles m_olFolderInbox.BeforeItemMove
    
        End Sub

    So this event fires allways EXCEPT for when you want to move an open mail item, from the ribbon option:

    ribbon move button

    But if you move this mail item from the explorer view its works fine, with ribbon button or with mouse right click option....

    any ideas??

    thanks!

    Mauricio.


    Mauricio

    Monday, September 17, 2012 5:25 PM

Answers

  • I went through my archive notes and it appears that this and another related bug with BeforeItemMove() were classified as "will not fix".

    The response from MS I got on this and the other BeforeItemMove() bug was "It was won’t fixed because this is an area of
    code that is highly subject to regressions and unforeseen issues".


    Ken Slovak MVP - Outlook

    • Marked as answer by MauricioUY Wednesday, October 21, 2015 2:36 PM
    Wednesday, October 21, 2015 2:12 PM

All replies

  • Is this a mail item that already exists and is stored in the Inbox folder?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "MauricioUY" <=?utf-8?B?TWF1cmljaW9VWQ==?=> wrote in message news:be47ab88-3b6f-4456-a268-7dae896b45ac...

    Hello,

    I'm working with a VSTO addin in VS2010, Outlook 2010 SP1 (14.0.6112.5000 32bits) and W7.

    I need to catch the move item event, so I created a class member Outlook.Folder object and handle the event "BeforeItemMove":

    .....
    Protected WithEvents m_olFolderInbox As Outlook.Folder 
    .....
        Private Sub m_olExplorer_FolderSwitch() Handles m_olExplorer.FolderSwitch
            If m_olFolderInbox Is Nothing Then
                m_olFolderInbox = m_olOutlook.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
            End If
        End Sub
    .....
        Private Sub m_olFolderInbox_BeforeItemMove(Item As Object, MoveTo As Microsoft.Office.Interop.Outlook.MAPIFolder, ByRef Cancel As Boolean) Handles m_olFolderInbox.BeforeItemMove
    
        End Sub

    So this event fires allways EXCEPT for when you want to move an open mail item, from the ribbon option:

    ribbon move button

    But if you move this mail item from the explorer view its works fine, with ribbon button or with mouse right click option....

    any ideas??

    thanks!

    Mauricio.


    Mauricio


    Ken Slovak MVP - Outlook
    Monday, September 17, 2012 6:51 PM
  • hi Ken, yes, this is a common mail item stored in the inbox folder.

    thanks,

    Mauricio.


    Mauricio

    Monday, September 17, 2012 6:57 PM
  • It looks to me like this is similar to a bug in BeforeItemMove() that was discussed recently in another thread. I was able to repro the bug in this case with the following Outlook VBA code:
     
    Dim WithEvents m_olFolderInbox As Outlook.Folder
     
    Private Sub Init()
        Set m_olFolderInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    End Sub
       
    Private Sub m_olFolderInbox_BeforeItemMove(ByVal Item As Object, ByVal MoveTo As MAPIFolder, Cancel As Boolean)
        MsgBox "It fired"
    End Sub
     
    I asked someone at MS to take a look at this thread and see what they want to do. I'll let you know what I hear, unless they post in the thread themselves.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "MauricioUY" <=?utf-8?B?TWF1cmljaW9VWQ==?=> wrote in message news:3655a3fc-b86c-4799-92c7-f2dbba20c9ba...

    hi Ken, yes, this is a common mail item stored in the inbox folder.

    thanks,

    Mauricio.


    Mauricio


    Ken Slovak MVP - Outlook
    Monday, September 17, 2012 8:00 PM
  • ok, thanks Ken.

    Mauricio

    Monday, September 17, 2012 8:34 PM
  • Hi Mauricio,

    Would it be possible for you to open a support incident for this so we can investigate whether or not we can fix this? I'm not sure offhand what's the best avenue for you to do that if you're outside of the US (maybe you have MSDN incidents?), but either way if you can let me know the incident number if you open one, I can make sure I get that.

    Thanks!


    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    Tuesday, September 18, 2012 3:16 PM
  • Hi Bill,

    sorry about the delay, I'll try to open an incident about this, the problem is that the person who has the task to open incidents with MS is on holidays right now.

    I let you know when the incident has been open.

    thanks,

    Mauricio.


    Mauricio

    Thursday, September 20, 2012 1:40 PM
  • Hello,

    wich KB fix this problem?

    thanks a lot,

    Mauricio.


    Mauricio

    Tuesday, October 20, 2015 7:26 PM
  • This is now 3 years later, did you ever file a bug report and support incident while Outlook 2010 was still in support?

    Do you still see this bug?

    At this time there's no chance the bug will be fixed if it isn't already fixed. Outlook 2010 is now out of mainstream support now that 2016 has released, and I don't see any bugs being scheduled for fixing now. If the same bug exists in Outlook 2013/2016 you can file a support incident to try to get it fixed there.


    Ken Slovak MVP - Outlook

    Tuesday, October 20, 2015 7:37 PM
  • Hi Ken,

    I was looking for that incident without no luck, so maybe we didn't start any incidient in that moment...

    We still have this bug, so I tried install this KB: https://support.microsoft.com/en-us/kb/2760764#/en-us/kb/2760764

    but it didn't work...

    To explore another workaround to my problem I only need to know if this problem was tagged like a bug in Outlook 2010 and if Microsoft made a fix for it.

    thanks!


    Mauricio

    Tuesday, October 20, 2015 8:13 PM
  • It is a bug and it was not fixed.

    I reproduced it here on the latest version of Outlook 2010. I have not tested or checked the bug on Outlook 2013 or 2016.


    Ken Slovak MVP - Outlook

    Tuesday, October 20, 2015 9:19 PM
  • I went through my archive notes and it appears that this and another related bug with BeforeItemMove() were classified as "will not fix".

    The response from MS I got on this and the other BeforeItemMove() bug was "It was won’t fixed because this is an area of
    code that is highly subject to regressions and unforeseen issues".


    Ken Slovak MVP - Outlook

    • Marked as answer by MauricioUY Wednesday, October 21, 2015 2:36 PM
    Wednesday, October 21, 2015 2:12 PM
  • Hi Ken,

    ok, I'll thinking in another workaround, thanks for your answer!

    cheers,

    Mauricio.


    Mauricio

    Wednesday, October 21, 2015 2:39 PM