I need to convert MSWord ".doc" files to plain data ".rtf" ones . . .

L

lbrtchx

~
I need to convert MSWord ".doc" files to plain data ".rtf" ones using
java
~
I know how to do this using MS Word's VBA, but I don't know how to
load the VBA libraries and run VBA programs from within java.
~
I tried searching on in but couldn't really find anything
~
How could you do this?
~
Thanks
lbrtchx
 
T

tzvika.barenholz

~
I need to convert MSWord ".doc" files to plain data ".rtf" ones using
java
~
I know how to do this using MS Word's VBA, but I don't know how to
load the VBA libraries and run VBA programs from within java.
~
I tried searching on in but couldn't really find anything
~
How could you do this?
~
Thanks
lbrtchx

Apache POI (poi.apache.org) is supposed to handle this sort of task. I
haven't got personal experience in it though, so I can't provide any
more than the pointer and a wish of good luck!
T
 
J

Jeff Higgins

lbrtchx wrote
~
I did a google search on: "import java" AccessBridge Word Windows and
got nothing
~

I tried a web search using the terms:
"import java" "AccessBridge" "Word" "Windows" and
would have been dissatisfied with the results had
I been looking for Java-COM Bridge functionality.

Did you follow the link I provided or
otherwise use the search terms: "java" "com" "bridge"?

If so, were the results helpful?

JH
 
L

lbrtchx

I did follow your links first but realized they were more about
accessibility and "philosophical" issues. I couldn't find some
starting code examples to do what I need.
~
I just need to access Word Documents and run their internal macros.
The part about using VBA to convert a ".doc" file to an RTF one I got
right already
~
It might be very easy maybe, something like:
~
String[] aSAr = new String[]{"<>/WinWord", "WordDoc.doc", ...};
System.exec(aSAr)
~
might work. I don't have a Windows Box to test this it right now, but
this code I am working on needs such a feature
~
lbrtchx
 
J

Jeff Higgins

lbrtchx wrote
I did follow your links first but realized they were more about
accessibility and "philosophical" issues.

Impedance mismatch in the google-fu, sorry. :|
 
J

Jeff Higgins

lbrtchx wrote
I just need to access Word Documents and run their internal macros.

Will you provide a link to the documentation
for Word Document internal macros?

Thanks,
JH
 
L

lbrtchx

I just need to access Word Documents and run their internal macros.
Will you provide a link to the documentation
for Word Document internal macros?
I meant Word's internal VBA macro language. You can code inside a
Word Document to do some things like the one I describe.
~
You just use a Word Doc as an automation engine to open another Word
Doc and save it as an RTF one
~
the apache poi projec look promising but they, (http://
poi.apache.org/) , say "Soon, you'll be able to read and write Word
files using Java." and I need my thing right now ;-)
~
lbrtchx
 
R

Ramon F Herrera

~
I need to convert MSWord ".doc" files to plain data ".rtf" ones using
java
~
I know how to do this using MS Word's VBA, but I don't know how to
load the VBA libraries and run VBA programs from within java.
~
I tried searching on in but couldn't really find anything
~
How could you do this?
~
Thanks
lbrtchx


What you need is OpenOffice. The regular installation already includes
the Java classes, etc. to develop applications. There is an SDK but it
is only required for the fancier stuff.

http://development.openoffice.org/index.html
http://www.oooforum.org/

The Eclipse plugin for OO needs some work (in fact, they may have
stopped working on it) so you are well advised to develop with
NetBeans because has an excellent OO plugin.

-Ramon
 
R

Ramon F Herrera

What you need is OpenOffice. The regular installation already includes
the Java classes, etc. to develop applications. There is an SDK but it
is only required for the fancier stuff.

http://development.openoffice.org/index.htmlhttp://www.oooforum.org/

The Eclipse plugin for OO needs some work (in fact, they may have
stopped working on it) so you are well advised to develop with
NetBeans because has an excellent OO plugin.

-Ramon


The SDK comes with several examples in the java/DocumentHandling
folder:

- DocumentConverter.java
- DocumentLoader.java
- DocumentPrinter.java
- DocumentSaver.java

-Ramon
 
R

Ramon F Herrera

seehttp://mindprod.com/jgloss/poi.html

[Roedy's site says:]
POI is not what I would call developer friendly.

As someone who I went down that path, I concur with Roedy. Like the OP
I was looking for a quick and dirty library to read/convert/write MS
Office docs. I figured that OpenOffice would be an overkill, but then
I realized that OOo already *is* installed in my computers and it has
all the functionality to be remote controlled from Java and many other
languages.

-Ramon
 
L

lbrtchx

Thank you very much Ramon!
~
it is nice getting help from someone that had been there before
~
However I tried to find "DocumentConverter.jar" so I could go
~
java -jar DocumentConverter.jar
~
and start tinkering with it, but I couldn't find this library and/or
documentation anywhere
~
http://lxr.go-oo.org/source/api/odk/examples/java/DocumentHandling/DocumentConverter.java
~
there is what seems to be a good example, but it needs other packages
I don't see anywhere
~
Could you point me to some comprehensive examples of using the doc
converter?
~
Also I see all examples are from MS Word 97, I hope OO can hande
Windows XP office ones as well
~
Thanks
lbrtchx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top