The Edraw Excel Viewer Component and Word Viewer Component support to ppen password protected word and excel file programmatically. You need call the SetValue method to set the password and writepassword before you call the Open method.
boolean SetValue([in] BSTR Name, [in] BSTR Value);
Sets the pasword, writepassword, domain and protectmodereminder
for the document.
Name: The name string.
Value: The value string.
The following vb script shows how to open a password-protected document. if the 1.docx file
has the password 1234, the writepassword 5678, you can use the follow sample.
edword.SetValue “Password”, “1234”
edword.SetValue “WritePassword”, “5678”
Leave a Reply
You must be logged in to post a comment.