gpt4 book ai didi

ms-office - PowerPoint - 如何以编程方式确定演示文稿是否有密码?

转载 作者:行者123 更新时间:2023-12-01 13:09:35 25 4
gpt4 key购买 nike

我正在编写一个处理 PowerPoint 演示文稿的应用程序,我正在研究检测 PowerPoint 演示文稿是否有密码的方法,如果它有然后停止处理它。

最佳答案

在我看来,有没办法查如果演示文稿受密码保护。您必须先打开文档才能访问属性。您必须在打开文档时提供密码。

有一个Password Property你可以检查。

我找到了一个 workaround on Expert Exchange :

The problem is the following: Visual Basic is a single threaded application, this means that you cant put a certain procedure on hold and proceed with another (in the same application). When powerpoint has an "on open"-password set, the CreateObject procedure inside your application is put on hold untill powerpoint releases it, this is when the user types in a password. There is no way around this that I know off, but you can make a workaround:

Make 2 applications, 1 application is the application you already have, the second one is a "powerpoint unlocker". You run the second program just before you open the protected powerpoint presentation in application 1. You can do that with the shell command. The "powerpoint unlocker" can be as advanced as you want it to be, you can for example provide command line parameters to specify which presentation must be unlocked with what password. Then you use the findwindow api to get the window handle of the locked presentation. Once you have that, you use the sendmessage api to input the password. After this the "powerpoint unlocker" unloads and the first application can resume with its excution.

I hope this helps!

Osmodean

关于ms-office - PowerPoint - 如何以编程方式确定演示文稿是否有密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/215946/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com