none
Setting and changing password to outlook pst files programmatically RRS feed

  • Question

  • Is it possible to set and change passwords to pst files programmatically ? I am developing outlook add in and I need to set or change (depends on user request ) password for pst file anytime. Can someone tell me if this is possible and how ?

    Thanks

    Tuesday, June 21, 2011 9:14 AM

Answers

  • Hi,

    The Outlook Object Model has no Method to assign a Password to a PST-File as I know.
    However, the CRC32 Hash of  Password is stored in the PidTagPstPassword Property.

    SO basically you can generate the CRC of a Password and set this Property and you'r done.

    please see

    http://msdn.microsoft.com/en-us/library/ff385916(v=office.12).aspx

    Greets - Helmut


    Helmut Obertanner [http://www.obertanner.de] [http://www.outlooksharp.de]
    • Marked as answer by Milos Rasuo Wednesday, June 22, 2011 1:11 PM
    Wednesday, June 22, 2011 9:30 AM
    Answerer

All replies

  • Hi,

    The Outlook Object Model has no Method to assign a Password to a PST-File as I know.
    However, the CRC32 Hash of  Password is stored in the PidTagPstPassword Property.

    SO basically you can generate the CRC of a Password and set this Property and you'r done.

    please see

    http://msdn.microsoft.com/en-us/library/ff385916(v=office.12).aspx

    Greets - Helmut


    Helmut Obertanner [http://www.obertanner.de] [http://www.outlooksharp.de]
    • Marked as answer by Milos Rasuo Wednesday, June 22, 2011 1:11 PM
    Wednesday, June 22, 2011 9:30 AM
    Answerer
  • Thank you but I don't know how to access this property in C# code. It is obviously that you need to know structure of pst file. I am beginner in Office programming. So if you can provide sample code I would be grateful.

    Regards Milos

    Wednesday, June 22, 2011 1:14 PM