none
Permission Issue in Outlook RRS feed

  • Question

  • Hi guys,

    I'm currently developing a library written in C# which can communicate with Outlook and wonder if I can get some advice.

    My situation: I am able to download email object (.msg) from outlook and save it to my desktop by using drag and drop or Save As menu in Outlook 2016.

    However, when I use MailItem’s SaveAs method of Microsoft.Office.Interop.Outlook, it is throwing the following error related to the permission.

    "Unable to display mail item: System.Runtime.InteropServices.COMException (0x80030005): You don't have appropriate permission to perform this operation.\r\n   at Microsoft.Office.Interop.Outlook._MailItem.SaveAs(String Path, Object Type)

    Since I have the permission to download emails in outlook manually, I am not sure what level of permission is needed here. 

    Could you guys advise if you have any clues?

    Tuesday, September 10, 2019 2:12 PM

Answers

  • Is it possible you are saving the MSG file to the directory where you do not have the write permissions?

    Do you specify a fully qualified path name when calling SaveAs? Otherwise Outlook will try to write to its current folder, which is most likely somewhere under Program Files, and most users have no write access there without at least an elevation.


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

    Tuesday, September 10, 2019 3:09 PM

All replies

  • Is it possible you are saving the MSG file to the directory where you do not have the write permissions?

    Do you specify a fully qualified path name when calling SaveAs? Otherwise Outlook will try to write to its current folder, which is most likely somewhere under Program Files, and most users have no write access there without at least an elevation.


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

    Tuesday, September 10, 2019 3:09 PM
  • Hi Dmitry,

    Yes, provided the full filepath and I am able to download msg file manually from outlook.

    Wednesday, September 11, 2019 6:32 PM
  • Hi Dmitry,

    Yes, provided the full filepath and I am able to download msg file manually from outlook.

    Wednesday, September 11, 2019 6:32 PM
  • What is the actual value of the Path variable? Does it include the file name? Or just the path?

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

    Thursday, September 12, 2019 10:29 PM
  • It included the file as well. Figured that it is admin access issue in my machine!
    Thursday, November 7, 2019 6:49 PM