Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can i creating a Blank/Empty WORD-doc via Java ??

807569Jul 12 2006 — edited Jul 12 2006
Hi friends,

My problem is to create a NEW blank Word Doc in an App..on the click of a JButton & then open it...

The Opening part is fine ( I'm using JDIC ...)

But creating a new MS-Word doc like the following does not work...!
File f = new File("sample.doc");

if(f.createNewFile( ))
{ 
// OPen the created file using JDIC's Desktop class...
}
The created file sample.doc is just of 0kb
But a "normal, valid" Blank NEW MS-Word Doc created USING MS-Word..is actually Much Bigger...

So, Does any one have an idea as to HOW to go abt THIS one ?!?!

[ I'm thinking of having a VALID Blank doc internally...and then copy it to a new file on the button click..but somehow, i feel there's a Better method...]

Any thoughts plz..??

Thanks....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2006
Added on Jul 12 2006
9 comments
204 views