none
Protected PowerPoint and password dialog RRS feed

  • Question

  • Hi,

    We have a password protected document, spreadsheet and presentation that we are opening from c# in a COM addin.

    we have successfully opened both the Word/Excel file thru an API, however it appears that PowerPoint works differently and forces the password dialog to popup.  The 'Hack' is to enter the password in by having the code function as if the user was entering it however like i stated that is a hack. so far we have not been able to find a elegant way to open a protected presentation without the password dialog showing.

    1. Does anyone know how to open a protected presentation in code without the password dialog?

    2. if we have to use the "hack" does anyone know how to hide the password dialog so that the process is not seen by the users as we through code enter the password?

    Tuesday, July 22, 2014 1:20 AM

Answers

  • Hi,

    >> I don't think you guys are understanding this issue.

    Sorry for the misunderstanding. You are correct that the ProtectedViewWindows.Open method is added from PowerPoint 2010.

    >> Given this, I want to hide the password dialogue when this key entering is happening.

    Technically, to hide this dialog, you need to get the handle of the dialog window and using Windows Native API to hide it, it would be a little complex and not recommended because it may cause the PowerPoint application unstable. Even after hiding the window, the SendKey function will not work because there are no focus on the hidden window.

    Regards,

    Jeffrey


    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, July 28, 2014 2:10 AM
    Moderator

All replies

  • It looks like you are interested in the Open method of the ProtectedViewWindows class.
    Tuesday, July 22, 2014 10:05 AM
  • Hi zy426f,

    Just as Eugene mentioned, please try ProtectedViewWindows.Open Method (PowerPoint)

        class PowerPointOpenProtectedSlides
        {
            public void Run()
            {
                var app = new PowerPoint.Application();
    
                PowerPoint.ProtectedViewWindow win = app.ProtectedViewWindows.Open(@"[filepath]", "[password]");
    
                win.Edit();
    
                app.Quit();
            }
        }

    Regards,

    Jeffrey


    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, July 23, 2014 2:37 AM
    Moderator
  • I don't think you guys are understanding this issue.

    Powerpoint 2007+ does not provide a way to open a password protected file from Code

    see this link

    http://social.msdn.microsoft.com/Forums/office/en-US/d760b4ac-48d7-483a-b442-9a7246fca628/how-to-open-a-password-protected-powerpoint-file?forum=officegeneral


    here is how others on this forum are doing it....

     "To do it programmatically, I think you can use the method of
    SendKeys.Send, you can find that the focus is on "OK" option, then when you click "Tab" Key , it  will transfer to "ReadOnly", then
    what we need to do is just click "Enter" Key on the Keyboard. All the process can be done automatically through writing the code
    like SendKeys.Send{"Enter"}; etc."

    Given this, i want to hide the password dialogue when this key entering is happening.

    I hoping  that one could find the id of the open "password" window and just minimize or hide it during this processes.

    • Edited by zy426f Friday, July 25, 2014 10:28 PM
    Friday, July 25, 2014 10:24 PM
  • Hi,

    >> I don't think you guys are understanding this issue.

    Sorry for the misunderstanding. You are correct that the ProtectedViewWindows.Open method is added from PowerPoint 2010.

    >> Given this, I want to hide the password dialogue when this key entering is happening.

    Technically, to hide this dialog, you need to get the handle of the dialog window and using Windows Native API to hide it, it would be a little complex and not recommended because it may cause the PowerPoint application unstable. Even after hiding the window, the SendKey function will not work because there are no focus on the hidden window.

    Regards,

    Jeffrey


    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, July 28, 2014 2:10 AM
    Moderator