none
A problem with SaveAs'ing a MailItem RRS feed

  • Question

  • Hello All,

    This issue was originally reported by our customer who tried to call MailItem.SaveAs(msg) on a new email, modify the body and call SaveAs again. The issue is: consequent body changes aren't reflected in the saved .MSG files; the original body text stays unchanged. According to the report, the issue is only reproducible on an Exchange mailbox, Cached mode=true. I reproduce the issue in the UI of Outlook 2016 32bit (=without any code); File | Office Account | About Outlook shows 16.0.6701.1013 32bit.

    BTW, does anybody know why on earth Current Branch on File | Office Account shows a different Outlook version?


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Friday, April 1, 2016 9:22 AM

All replies

  • Hi Andrei,

    It is a bug. I can reproduce it too with Outlook 2016 (x86).


    Friday, April 1, 2016 10:27 AM
  • Did you call MailItem.Save before calling SaveAs?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, April 1, 2016 2:51 PM
  • Dmitry,

    Is there any requirement to call Save prior SaveAs?

    Of course, calling the Save method helps. And the EntryID property is set when the SaveAs method is called too.

    Friday, April 1, 2016 3:50 PM
  • Yes, Save ends up calling IMessage::SaveChanges, and that is where the magic happens - the store provider updates PR_DISPLAY_TO/CC/BCC based on the contents of the recipient table, synchronizes the 3 flavors (plain, HTML, RTF) of the message body, etc.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, April 1, 2016 4:10 PM
  • Then I bielive the Outlook team should include the Save method as a part of the SaveAs call to reflect all changes in the MSG file. Saving items to disk and not seeing recent changes there - it is definitely a bug!
    Friday, April 1, 2016 5:19 PM
  • Then the changes will be committed even if you did not mean to. That will be an ever bigger bug.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, April 1, 2016 5:27 PM
  • Did you call MailItem.Save before calling SaveAs?

    Hello Dmitry,

    Yes, I did. And it helps in solving the issue programmatically. But the problem is: the issue is reproducible by performing the same steps using the Outlook UI options, that is without writing a single code line.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Saturday, April 2, 2016 7:41 AM
  • I agree with Andrei. User expirience leaves much to be desire in that case. Users expect to see recent changes in MSG files. It is a bug.
    Saturday, April 2, 2016 8:13 AM
  • So it still does not work even if you call Save?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, April 2, 2016 8:15 PM
  • Hi Andrei,

    I am tested this issue using Outlook 2016(16.0.4312.1000, MSI), however failed. Did you use the click-to-run or MSI version of Outlook?

    If you were using the MSI version, would you mind sharing us the detail how you update the Outlook 2016?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 4, 2016 2:24 AM
    Moderator
  • So it still does not work even if you call Save?
    Clicking the Save button once fixes the issue: starting from this moment saving an item produces the changed body in the .MSG file. In my opinion, such user experience is far from exemplary.

    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Wednesday, April 6, 2016 11:55 AM
  • Hi Andrei,

    I am tested this issue using Outlook 2016(16.0.4312.1000, MSI), however failed. Did you use the click-to-run or MSI version of Outlook?

    Hello Fei,

    I use the ClickToRun version.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Wednesday, April 6, 2016 11:56 AM
  • That very well might be, but unless you can convince Microsoft to patch all version of Outlook out there, the best you can do is just live with it :-)

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, April 6, 2016 8:34 PM
  • the best you can do is just live with it :-)
    This is what I have always been confident of. ))

    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Thursday, April 7, 2016 9:36 AM
  • Hi Andrei,

    I am testing using Outlook 2016(16.0.6729.1012) 32-bit, click-to-run. However still not able to reproduce this issue. Here is the steps for testing:
    1. Create a new message

    2. type "Hello" in the body and save

    3. Type " World!" and using the saveAS

    4. Open the saved message, it show the content with "Hello World!" correctly

    If you were not using the latest version of Office, I suggest that you update it. Or you can try to repair the office to see whether the issue was fixed.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 11, 2016 9:36 AM
    Moderator
  • Thank you, Fei.

    For me, the issue occurs if I use SaveAs in step #2 (instead of using Save).


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Monday, April 11, 2016 9:53 AM
  • Hi Andrei,

    Thanks for the detail information for this issue. However, I am still not able to reproduce this issue by steps below:

    1. Create a new message

    2. type "test" in the body 

    3. Using the saveAS

    4. Open the saved message, it show the content with "test" correctly

    Here is the Outlook I am testing:

    Would you mind sharing which version of Outlook are you using?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 13, 2016 1:59 AM
    Moderator
  • Thank you for pursuing the goal!

    After following steps ##1-4, do the following:

    5. modify the subject and type "test2" in the body;

    6. SaveAs

    7. Open the saved message; it doesn't contain "test2" for me

    I use the same build of Microsoft Office Professional Plus 2016.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Wednesday, April 13, 2016 6:32 AM
  • Hi Andrei,

    Thanks for the detail explanation for this issue. However I am still not able to reproduce this issue and I have recorded the screen. Since the image is too large, I upload it to the OneDrive. You can download it from here:

    https://onedrive.live.com/redir?resid=AF618BBEF578722D!74219&authkey=!AOIt67VO-6qjCOo&v=3&ithint=photo%2cgif 

    Is it helpful to repair the Outlook?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 14, 2016 6:59 AM
    Moderator
  • Thank you for the GIF. It shows that you perform these steps on the saved .MSG; the issue occurs if you perfrom these steps on a new unsaved item. That is, create a new item, set its subject and body, SaveAs, once again modify the subject and body of the same item (the item isn't saved yet), invoke SaveAs again and you'll see the last body modifications are missing on the MSG.

    Hope this helps.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Thursday, April 14, 2016 7:11 AM
  • Hi Andrei,

    Thanks for the detail exploitation. 

    I could reproduce this issue with steps below:
    1. Create new message

    2. Type "a" in subject and body

    3. Press SaveAs to save the message to a.msg

    4. Append character "b" in subject and body

    5. The modification in subject was saved but the message body was not.

    Since this issue is complex, I am trying to report this issue internally. 

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, April 15, 2016 6:32 AM
    Moderator
  • Thank you for letting me know!

    My name is Andrei, please ))


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Friday, April 15, 2016 8:40 AM