none
Problems with GetInspector and drafts RRS feed

  • Question

  • Hi All,

    We have an application that allows users to SpeechRecognize into various programs, among them outlook, and we have had an issue pop up where our users are losing the drafts they are making and we have tracked this down to a GetInspector call:

    This is reproduced by, opening outlook and reply to an email usinng the inlineresponse feature.

    1. Run the following code snippet in for example a console application:

    var application = Marshal.GetActiveObject("OUTLOOK.Application") as Application;
                _MailItem inlineResponse = application.ActiveExplorer().ActiveInlineResponse;
                var inspector = inlineResponse.GetInspector;
                Console.WriteLine("Done");
                Console.ReadLine();

    2. Type some text in the inline response email.

    3. Click on another email in the mailbox

    4. Go to the draft folder and open the draft for the email just created, the text that was typed previously is now missing.

    We're using Microsoft.Office.Interop.Outlook.dll and OFFICE.DLL both is version 15.0.0.0

    I'm using Outlook version 1708 (Build 8431.2270)

    Wednesday, July 4, 2018 1:19 PM

All replies

  • Hello Carsten79,

    Since you have called the mails inspector, why not continue your operation on the inspector?

    Use inspector.Display() to show the inspector to continue your operation on the inspector.

    You could also try to use inspector.Close(olSave) to close the inspector and save current edit content.

    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, July 5, 2018 2:52 AM
  • Hi Terry,

    Thanks for your reply.

    The code pasted was merely an outtake of a much larger codebase, it's designed to be the most simple way to show the issue we're having.

    The user has opened an email themselves, it's not something we do programmatically so it doesn't make sense to call Display(), the same with calling Close(), we do not know when the user is done working with the email.

    Maybe I didn't explain our usecase clearly enough:

    A user clicks on an email in outlook, and then clicks on reply, this opens a inline response editor (IE not a new window) out software detects this and runs the code above, this enables the user to dictate text into the email using their voice. (we do this by accessing the WordEditor of the Inspector). Once the user is done inserting text, either via voice or via the keyboard, they click on another email in their inbox, a draft is now saved, but none of the text entered into the email was saved in the draft, it's gone, and it only happens if we call GetInspector.


    Thursday, July 5, 2018 7:28 AM
  • Hello Carsten79,

    Based on the explanation of GetInspector: "If an Inspector object already exists for the item, the GetInspector property will return that Inspector object instead of creating a new one."

    So once you call the GetInspector, there is an Inspector created for editing the mail. So there are two editor are editing the mail now, one is the Inspector and the other is the InlineResponse. I think it is not a good idea and there maybe conflict with them to edit same mail.

    Why do you need get the WordEditor to edit the dictate text? Is there any way to dictate text into the InlineResponse 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, July 6, 2018 6:24 AM