Address: http://www.evget.com/zh-CN/Info/catalog/18013.html
Microsoft Word and Excel can help you protect the security of your documents. Therefore, many documents provide the password and writepassword attributes. Edraw office viewer component
The component allows developers to open a password protection document without a message box. This component supports seamless integration with Office 97, Office 2000, Office 2003, Office 2007, and office 2010.
Password protection dialog box
Writepassword protection dialog box
To delete the two protection dialog boxes, follow these steps:
Before calling the open method, you can use the setvalue method to set the password and writepassword attributes for the Word and Excel files. It is best to add the setvalue method to the beforeappsentopened event or the policyctrlready event.
Boolean setvalue ([in] BSTR name, [in] BSTR value)
Set the password of the document, writepassword, domain, and protectmodereminder.
Name: The name string.
Value: The value string.
For example:
The following VBScript shows how to open a password-protected document. The password of the 1.docx file is 1234, And the writepassword is 5678. You can use the following example:
Sub setvalue_example () edoffice. setvalue "password", "1234" edoffice. setvalue "writepassword", "5678" edoffice. Open "C: \ 1.xls" end sub