Apache OpenOffice (AOO) Bugzilla – Issue 24690
Opening a Password Protected Document through API Pops Dialog
Last modified: 2013-02-24 21:06:34 UTC
STEPS TO REPRODUCE: 1. Create an MS Word document that requires a password to open. 2. Write some Java code to open this document using OpenOffice.org 1.1 on Windows 2000. 3. Run this code. OBSERVED BEHAVIOR: OpenOffice.org pops up a UI dialog saying that "password protected documents cannot be opened." EXPECTED BEHAVIOR: When driven from the API, the product is expected to return the error to the caller by means of throwing an exception or another programmable means. The UI dialog is inappropriate in such cases.
I don't know where the dialog comes from, Writers Word import filter or Sfx, thus guessing
I cant reproduce this behaviour. Please try the following basic code: sub main dim args() as new com.sun.star.beans.PropertyValue dim doc as object dim url as string url = "file:///c:/password.doc" doc = StarDesktop.loadComponentFromURL(url , "_blank", 0, args()) msgbox isnull(doc) end sub Here no UI was detected and the document couldnt be loaded (means doc=null).
.
Maybe this is happens only in certain cases. I am attaching some sample code in Java that will load the document for you in OpenOffice.org 1.1. Please try to reproduce the behavior with this code (which is theoretically the same as your StarBasic code).
Created attachment 12756 [details] Java code to be run from command-line
Sorry - but it doesnt matter if you call loadComponentFromURL() from java or from basic. The implementation of this method is always the same ... and BTW an implementation object cant detect, from which location its called. Please try to reproduce the behaviour with the given basic script. May be you was connected to an older office version? I cant reproduce your problem here.
returning to reporter
set status to resolved/invalid.
close issue. please feel free to reopen if there are still question open