Running macro on password protected word document

Hi Team,

I know this is not related to Aspose directly, but something you could have heard or handled before.

These are the steps current I follow.

  1. Generate a password protected word document using Aspose.
  2. Run a macro from command line (from Java) using cscript
  3. Step 1 and 2 happens with a single click from our tool.
Since the document is password protected, is there a way to open the generated document through command line by passing the password so that user intervention is not necessary while running the macro?

By the way, I’m currently using AsposeWordsJava v13.5.

Thanks,
Kumar

Hi Kumar,

Since steps 1 and 2 happen with a single click, you can do any of the following:

  1. Generate unprotected document, run macro and protect document(using Aspose.Words)
  2. Unprotect document (using Aspose.Words), run macro and protect document again (using Aspose.Words)

Best Regards,

Hi Muhammad,

Thanks for the solution.

This would have performance and memory impact for huge documents as
loading and saving document happens again. I’ll anyways analyze performance and memory impact for this.

Thanks,
Kumar