Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
lbrtchx@gmail.com - 30 Dec 2007 13:52 GMT
~
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
Jeff Higgins - 30 Dec 2007 14:54 GMT
> ~
> I need to convert MSWord ".doc" files to plain data ".rtf" ones using
[quoted text clipped - 7 lines]
> How could you do this?
> ~

<http://www.google.com/search?hl=en&q=java+com+bridge>
lbrtchx@gmail.com - 30 Dec 2007 15:13 GMT
> On Dec 30, 9:54 am, "Jeff Higgins" <oohigg...@yahoo.com> wrote:
> <http://www.google.com/search?hl=en&q=java+com+bridge>
~
I did a google search on: "import java" AccessBridge Word Windows and
got nothing
~
lbrtchx
Jeff Higgins - 30 Dec 2007 15:35 GMT
lbrtchx wrote

>> <http://www.google.com/search?hl=en&q=java+com+bridge>
> ~
> 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
lbrtchx@gmail.com - 30 Dec 2007 15:54 GMT
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
Jeff Higgins - 30 Dec 2007 16:01 GMT
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. :|
Jeff Higgins - 30 Dec 2007 17:43 GMT
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
lbrtchx@gmail.com - 30 Dec 2007 22:27 GMT
> > 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
tzvika.barenholz@gmail.com - 30 Dec 2007 15:20 GMT
On Dec 30, 3:52 pm, lbrt...@gmail.com wrote:
> ~
>  I need to convert MSWord ".doc" files to plain data ".rtf" ones using
[quoted text clipped - 9 lines]
>  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
Ramon F Herrera - 31 Dec 2007 09:09 GMT
On Dec 30, 9:52 am, lbrt...@gmail.com wrote:
> ~
>  I need to convert MSWord ".doc" files to plain data ".rtf" ones using
[quoted text clipped - 9 lines]
>  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
Ramon F Herrera - 31 Dec 2007 09:41 GMT
> On Dec 30, 9:52 am, lbrt...@gmail.com wrote:
>
[quoted text clipped - 23 lines]
>
> -Ramon

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

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

-Ramon
Roedy Green - 31 Dec 2007 23:04 GMT
> I need to convert MSWord ".doc" files to plain data ".rtf" ones using
>java

see http://mindprod.com/jgloss/poi.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Ramon F Herrera - 31 Dec 2007 23:32 GMT
On Dec 31, 7:04 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Sun, 30 Dec 2007 05:52:30 -0800 (PST), lbrt...@gmail.com wrote,
> quoted or indirectly quoted someone who said :
[quoted text clipped - 6 lines]
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com

[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
lbrtchx@gmail.com - 01 Jan 2008 18:51 GMT
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/DocumentConve
rter.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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.