File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

password protecting a MS word Document

 
Shyam Sunder V R
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
I want to set a password to a MS Word Document ...The way to do it manually is to go to

File - Save As - General options - Set password


I google-d a lot and Couldn't find a way to do it with Java.Can any of you guys help me with the java code for it ?Thanks

JUST WANT TO WARN YOU : I DON'T WANT TO ENCRYPT THE WORD DOCUMENT...JUST WANT TO SET A PASSWORD
 
Tim Moores
Bartender
Pie
Posts: 2491
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard way to do this in Java would be to use the Apache POI, but unfortunately it seems to support passwords only for spreadsheets, not word documents.

It may be possible by using the OpenOffice API in OO's server mode (big learning curve ahead of you if you've never used it).
 
Shyam Sunder V R
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If anyone who's worked with the API that you have mentioned above could give me a sample code or something or a guidance note It could greatly reduce my effort
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic