none
VSTO BeforeAttachmentAdd: Weird behaviors RRS feed

  • Question

  • Hi All!

    I am having weird problems using this events.

    If I attach more than 1 file using the insert-file menu and I cancel the first attachment (bCancel=true) then all remaining attachments are canceled! This does not happen with all OL2016 but at least with some versions it happens (versión 1708 - Build 8431.2250)

    Also that event is not fired if you drag files to the Attachment Area (All OL2016 versions)

    I do not want to open a ticket since another guy already did it and MS closed that ticket without any solution:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/940ebe46-04d6-4daf-80c5-1bd26ace5e12/catching-event-attachmentadd-sometimes-results-in-cannot-create-attachments-in-outlook-2016-only?forum=vsto

    It's just crazy that MS keeps having this VSTO technology with such bugs. It's not that they did not realize of the problem, but it seems they don't care.

    Is it a strategy or what?

    It's impossible to develop VSTO addins with these bugs. This is only 1 case I reported, but there are many other cases.

    The only solution for ISV is to use function interception with reverse engineering approaches to bypass such problems, but this is not supposed to happen.

    Thanks

    Wednesday, June 13, 2018 2:40 PM

All replies

  • Hello Pablo,

    Let me clarify something for you. VSTO and the Outlook object model are entirely different things. The bug described above comes from Outlook (OOM), not VSTO. VSTO is a set of tools for simplifying Office COM add-ins development.

    I'd suggest opening a support ticket with Microsoft. You will not be charged if the bug is confirmed. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, June 14, 2018 12:43 AM
  • Hello pablo_1975,

    I agree with Eugene that your issue should be more related to Outlook Object Model rather than VSTO. 

    If you do get any bug, you could go to File->Feedback to submit  feedback for the issue. MS Office Development team will try to fix the issue if they confirm the issue does exist and publish the latest version for updating.

    In the current thread, for the issue you stated, I tried to test it in the latest version Office(Version 1805 Build 9330.2118), both of them do not occur now. So I would suggest you update your Office to latest version to solve the issue.

    Here is my test result.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 14, 2018 6:42 AM
  • Hi Terry and Eugene,

    I did a VSTO Project... so based on what you say it seems VSTO is a wrapper of OOM?

    The guy in the link I provided already reported that same bug without success.

    I appretiate the time you spent on trying to reproduce the issue but this is not what I reported. You attach the files to the message body and this works OK here too.

    What I say is that the attachments must be attached to the "attachments area". That is, you attach file.txt to the message (since the attachment area is not yet created), then when you see file.txt in that message, you drop the files to the place in the message near text.txt (attachment area) and you will see that the Before event is not triggered.

    Also if you use your code but using the file attach (insert-file) dialog and you attach Book1.txt, Book2.txt, Book3.txt, book4.txt (but be sure that book1.txt that is canceled is processed before) then you will see that when canceling book1.txt it will prevent other attachments (if they come next) from being attached.

    Thanks

    Thursday, June 14, 2018 11:09 AM
  • Hello pablo_1975,

    As the name said, Visual Studio Tools for Office, VSTO is set of tools for Office to host the .NET Framework Common Language Runtime (CLR) to expose their functionality via .NET. What it could done on Outlook is still based on the Outlook Object Model. In fact, expect VSTO, I could also reproduce your issue via VBA or a windows form since I used OOM.

    For your issue, I think the issue the event does not trigger has been resolved and another issue the event cancel further attachments while dropping multiple attachments into the attachment area does still exist. I would suggest you go to File->Feedback to submit a feedback for the issue. Or you are using an Insider version, you could report it as bug to Outlook Team directly.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 15, 2018 9:52 AM