5
I can normally open a file .docx in Word using the desktop.open
java, but there is a case where I need to open the document that is password protected and Word opens asking for it. Is there any way I can still enter the password in the program and when opening the document it already opens without asking?
Part of the code I’m using:
public void actionPerformed(ActionEvent e) {
try {
Desktop desktop = Desktop.getDesktop();
File file = new File("" + caminhofonte1global.getSelectedFile());
desktop.open(file);
}
catch (IOException ioe) {
ioe.printStackTrace();
}
}
I was already looking for and reading about this Apache but had not understood how the opening with password worked. Thank you very much!
– João Pedro Silva Dezembro