Article View: borland.public.jbuilder.java.language
Article #8033Re: Launching a Word document in a Java program under Windows 98
From: John McGrath TeamB
Date: Sat, 28 Apr 2001 10:42
Date: Sat, 28 Apr 2001 10:42
28 lines
1967 bytes
1967 bytes
On Wed, 25 Apr 2001 11:17:39 +0200, Luc BONAMEAU wrote:
> Under Win NT, this is what I do to lauch a my word document or any document
Try this:
Runtime.getRuntime.exec( new String[] { "rundll32",
"url.dll,FileProtocolHandler", fileName } );
I have not actually tried this exact code, but I think it should work.
Under Windoze, this should launch the configured handler application
for any file -- an HTML file, MS Word document, PDF file, etc. If you
use this, you do not have to know where the application executable is
stored, or even what application should be used for a given document.
The fileName argument can also be a URL string, so the document does
not have to be on a local filesystem. I believe it can also be a
filename using normal (forward) slashes, rather than backasswards
Windows ones.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.155460bb89bf12298a151@forums.borland.com>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ae695f7_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,d184d9727f26bf11 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-28 04:16:04 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Launching a Word document in a Java program under Windows 98 Date: Sat, 28 Apr 2001 06:42:21 -0400 Message-ID: <MPG.155460bb89bf12298a151@forums.borland.com> References: <3ae695f7_1@dnews> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 988454540 209.92.40.60 (28 Apr 2001 03:42:20 -0700) Lines: 28 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews