Opening a word file in MS Office Word software window through Java code

I want to open a word file in MS Office Word software window through Java code.
Is it possible ? If possible then please let me now how can I do it.
Bhoopender

Thanks for replying.
I tried the following code -
public class OpenFileWithItsExt
     public static void main(String[] args) throws java.io.IOException
          Runtime.getRuntime().exec("a.doc");
and it gets compiled successfully, but on running outputs as -
Exception in thread "main" java.io.IOException: CreateProcess: a.doc error=193
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at OpenFileWithItsExt.main(OpenFileWithItsExt.java:5)
My file is in the pesent working directoty.
Please solve my problem.
Thanks

Similar Messages

  • Need Help Opening a Corrupted File in MS Office Word 2007.

    I use Microsoft Office Word 2007. I need help in opening a corrupted file. I tried to open but am getting messages: "cannot be opened", "unreadable content", "do you want to recover contents?" "Do you want to search
    for a converter?"
    Anyone have any ideas on how I can get this file to open? :/
    Thank you,
    Chuck in California

    From Microsoft Documentation:-
    If a file has been damaged and you cannot open it by normal means, you may be able to recover its content by using the Open and Repair
    feature.
    Click the
    Microsoft Office Button
    Browse to the file that you want to recover, and click it (do not double-click it).
    Click the arrow next to the
    Open button, and then click Open and Repair.
    You might also like to look at this (which is just a longer version of what's above):-
    http://support.microsoft.com/kb/893672?wa=wsignin1.0 

  • How can I open AppleWorks 6 files using Pages or Word?

    I am currently running Mac OS X v.10.4.11, but I am turning in my old mac for a new one in about a week. Almost all of my important files are AppleWorks 6 files and my new mac will not have this program since it has been replaced with Pages. I currently have AppleWorks 6, Microsoft Word 2004 for Mac, and Pages 08 on my old mac. I am unsure as to what applications I will have on my new mac (I am a teacher and the macs are school computers so I do not have control over the software), but I think it will have both Word 2008 and Pages 08 or 09. So far I have not had any luck opening my AppleWorks files in Pages or Word. I have been able to copy and paste the AppleWorks files into Pages (they are mostly Draw documents, not simple word processing), but they become an image so I cannot edit the content. I need to be able to edit my documents on my new computer and do not have time to open each AppleWorks file and copy it to Pages anyway. Any suggestions to help me with this compatibility problem?

    AppleWorks will run fine on your new Mac, though if you transfer it from the old one you should delete it from there to stay within the terms of the licence. You would need to copy the Appleworks folder over, not just the application.
    Pages can open Appleworks 6 word processing documents, Numbers can open Appleworks 6 spreadsheets. It's possible to open AW Draw documents in Eazydraw, or in Pages through a workaround. Nothing will open AW Database documents.
    I have written a detailed article going into the process of migrating from Appleworks, including the workaround for Draw>Pages:
    http://www.wilmut.org.uk/aw

  • I need to open and use Excel and Word files on my iPad, which software need to get?

    I need to open and use Excel and Word files on my iPad, which software need to get?

    The options include :
    Apple's Pages app for Word docs and Numbers for Excel spreadsheets
    There are also third-party apps which support both word and excel in the one app e.g.Documents To Go and QuickOffice HD

  • Problem in copy 2 WORD files to a new WORD file

    Hi
    I have a problem in copy 2 WORD files to a new WORD file -
    i.e. the text of the new WORD file suppose to be composed from the text of the 2 original WORD files.
    Unfotunately I get a new WORD file which i can't open, or a file which contains strange simbols in it.
    So far i succeded in copy one WORD file to a new WORD file , using - FileOutputStream and FileInputStream, the code is:
    import java.io.*;
    public class IOStreamDemo {
    public static void main(String[] args)throws IOException {
    InputStream in2 = new FileInputStream("fruit.doc");
    OutputStream out2 = new FileOutputStream("dst2.doc");
    // Transfer bytes from in2 to dst
    byte[] buf2 = new byte[1024];
    int len2;
    while ((len2 = in2.read(buf2)) > 0) {
    out2.write(buf2, 0, len2);
    in2.close();
    out2.close();
    Does sombody know how to do it properly?
    Thanks

    dear friend
    I just create two word file one is fruit.doc and other
    is dst2.doc
    after that i write some lines in fruit.doc
    then I just execute your code.
    after that I open dst2.doc
    then I found it as exact copy of fruit.doc
    I doesn't get any junk text.
    Your code is working absolutely fine.No it is not. Add som styling, headers, index etc to the docuements, and then try to run the code. It's not possible to just append two word documents. You have to parse the files and read relevant information, and then create a new valid document with that information.
    /Kaj

  • I have design standard with creative cloud, I have installed this on 2 computers, my office and home which I was told was allowed, I have just tried to open an indesign file from the office at home and and error message said that this was created with a n

    I have design standard with creative cloud, I have installed this on 2 computers, my office and home which I was told was allowed, I have just tried to open an indesign file from the office at home and and error message said that this was created with a newer version? they are the same versions and both are up to date, I was asked this morning to put in my adobe id email and password to connect to CC which I have never been asked to do before, can anyone help?

    what's your home version (click help>about) and was that just a warning so you were able to open the file?

  • Microsoft Word 2007 states "Microsoft Office Word Has Stopped Working"

    Microsoft Word 2007 states "Microsoft Office Word Has Stopped Working" after I close any word document, (newly created or old word documents). Functionality of Word appears to be fine, I'm just tired of it crashing everytime I close it. Please HELP!
    I am using Windows Vista, Service Pack 2 and Microsoft office 2007. The funny thing is, that when you are logged in to the other profile that we have created on our computer, Microsoft Word seems to work perfectly fine. The followiing is the exact "problem
    signature":
    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: WINWORD.EXE
    Application Version: 12.0.6541.5000
    Application Timestamp: 4c38f4a9
    Fault Module Name: StackHash_7ea6
    Fault Module Version: 6.0.6002.18005
    Fault Module Timestamp: 49e03821
    Exception Code: c0000374
    Exception Offset: 000afaf8
    OS Version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033
    Additional Information 1: 7ea6
    Additional Information 2: ac730771d80f73e85b4b32dbb839afea
    Additional Information 3: dd03
    Additional Information 4: 741335d7d979867fc01d44e6acd4ebee
    Read our privacy statement:
    http://go.microsoft.com/fwlink/?link...3&clcid=0x0409
    If you can explain the solution in the most simple terms possible, it would help a lot. Thank you in advance.
    --Ty

    Hi,
    This issue may occur due to conflict with certain software\driver such as PDF add-ons or default printer software.
    To resolve your issue, you can follow the methods below to delete the corresponding registry:
    1. Click Start , type regedit in the Start Search box, and then press ENTER.
    2. If you are prompted for an administrator password or for a confirmation, type the password, or click Continue.
    3. Locate and then click the following registry subkey:
    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Data
    4. On the Edit menu, click Delete, and then click Yes.
    5. Exit Registry Editor.
    6. Restart Word
    Hope it helps.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • JACOB: how to create Word files and not launch Word?

    While trying jacob.jar to manipulate MS Word documents, I wish to create Word files without launching the Word program. Since I can't find jacob.jar's API documentation, please tell me how to do it. Thanks!

    jacob should be found at http://danadler.com/jacob but it don't seem to be working at the mo, not sure it its a temp. problem or something long term.

  • I have CC and bridge, bridge will open but I cannot open a photo file.  I get a message: Windows cannot fint C:............... CS4 ck to see if you have spelled properly. Any Ideals?             a message: Windows cannot

    I have CC and bridge, bridge will open but I cannot open a photo file.  I get a message: Windows cannot fint C:............... CS4 ck to see if you have spelled properly. Any Ideals?   I had CS4 but have since removed it.   

    A couple of possibilities:
    How did you remove CS4 ?  If you removed it improperly instead of Uninstalling it (say, you "deleted" it or just dragged it to the Recycling Bin), you almost certainly left stuff behind that needed uninstalling.
    What's even worse, if you removed CS4 after you installed CC you may have messed with the CC installation.
    I'm not going to attempt to tell you how to fix it, since this will probably involve uninstalling CC and after that looking for, downloading the Adobe CS_Cleaner tool and the CC_Cleaner tool, then re-installing CC, since I'm not a Windows user and don't want to mislead you.
    In any case, when Windows users chime in to assist you, they'll need all the details which you have not provided so far.

  • Import a biar file into a specific folder in CMS through java sdk

    Hi,
    How to import a biar file into a specific folder in CMS through java sdk?
    Can anyone help.
    Regards,
    Kavitha S

    Hi Kavitha,
    Have a look at the sample available at
    http://scn.sap.com/docs/DOC-6006, for importing a biar file using java sdks.
    As far as I am aware of, you would not be able to import the contents of a biar file to a specific folder.
    Why would you want to use a biar file to import contents to a different folder?
    Organize>Move functionality from CMC/Infoview/BILaunchpad can work for this.
    -Prithvi

  • Opening Winmail.dat files in Mail on iPad (Ms Windows Word, Excel, Ppt)

    I thought I'd share my findings on what to do if your Word, Excel, Powerpoint attachments come into your Mail as winmail.dat files. In my experience I downloaded the following Apps:
      Pages
      Numbers
      DocsToGo
    WinMailViewer
      Letter Opener
    To open the winmail.dat file hold the icon until asked how you want to open the file: WinMailViewer or Letter Opener (assuming you've previously downloaded both Apps).
    WinMailViewer is exactly what it says ... a 'viewer' of the file.  The file is sent to the relevant App which you subsequently open to see a list of the files.
    Letter Opener will bring up the attachment(s) in a separate window and gives you choices on which App you'd like to use to open or view the file with. Depending on what Apps you've previously downloaded:
      For Excel it might list: Quick Look, DocsToGo, Csv File Editor, PDFReaderLite
      For Word, it might list: Pages, DocsToGo, PDFReaderLite
    DocsToGo is an excellent option for working on Word, Excel files (N.B. If you have a big Excel file with 'frozen' window panes, I recommend clicking on the 4th tool (bottom toolbar) UnFreezing the panes while you work or move around the file as I haven't figured how to work with it on!!)
    Pages is the best option to use for editing Word files.
    Numbers is probably the best option to use for editing Excel files.
    Csv File Editor is another Excel editing option.
    I hope that helps.

    I should further say the files I sent are .xlsx and .docx files.  They look fine my end and I send such files all the time without problems.
    However, I did try to cheat by going in via the Safari onto my 'live' online email account and the Safari automatically transfers them to winmail.dat files with the same result.
    Ahh - have just been on using my PC this time and you are right, it seems that the service provider does the transfer and then when my outlook opens the file (on the PC), it must reconvert to .xlsx etc again.
    Very strange.
    Ergo, I guess the question should be how I open wimail.dat files ??

  • Exported Word files set off virus alerts for Windows users.

    Work for a communications agency. Many of us prefer to write our copy in Pages, then export to Word files when sending over to clients to review. But, our exported "Word" files set off all our clients virus alerts like clockwork. Is there any way to prevent this besides exporting to RTF or PDF?
    I've been told that Pages files exported out to Word files contain benign "macros" under the hood. And that virus alert programs on the Windows side see these macros (however harmless they are) and warn the user to not open, or trash the files.
    This is causing hardship for us wanting to switch over to using Pages full-time. To our clients, it makes it seem as if we are careless, or are sending them files with viruses all the time.

    bkjj40a wrote:
    Work for a communications agency. Many of us prefer to write our copy in Pages, then export to Word files when sending over to clients to review. But, our exported "Word" files set off all our clients virus alerts like clockwork. Is there any way to prevent this besides exporting to RTF or PDF?
    I've been told that Pages files exported out to Word files contain benign "macros" under the hood. And that virus alert programs on the Windows side see these macros (however harmless they are) and warn the user to not open, or trash the files.
    As far as I know, there is no macro in files created by the Pages export process.
    I'm on the Pages forums since two years and never read any message about such a behavior.
    My guess is that the problem is not in Pages.
    Maybe you are using the same anti-virus than my brother.
    It rejects all jpegs claiming that they have a virus embedded
    Yvan KOENIG (from FRANCE dimanche 14 juin 2009 10:48:07)

  • How to Copy all the text blocks of a converted Word file (Converted PDF TO WORD)

    We have scanned a English book quite a some time ago. Now we have converted it to a Word Document.
    We try to copy the whole text and re-format it and save it as Word/PDF
    The problem is we cannot copy the whole document since it has the text as various blocks.
    It is very hard to select each box and put in a word document or in a notepad.
    Could you please tell me how to select the whole document or whole blocks with single stretch or any easy way to do it?

    "Scanned" -- That tells the story.
    The output of all scanners is an image, a picture if you will, of the paper source.
    Pictures of text are not the "text" itself and thus there is no "text" to copy (let alone paste).
    For PDF files that hold the picture of text that is the output of a scanner you would want to open the PDF with Acrobat.
    Now use Acrobat's OCR capability.
    Suggestion: Use Acrobat's ClearScan. This is "friendlier" to doing touchups to characters / words.
    Export this to Word (Use Acrobat Pro or one of Adobe's online subscription services - ExportPDF or PDF Pack).
    DO expect to do cleanup in the Word file.
    Whenever the source is a scanner's output picture you have a pig's ear & you cannot make a silk purse from that.
    Be well...

  • How to open a lost file in Microsoft Office Autorecovery

    Excel crashed and when it autorecovered my file upon restart it opened the original file with none of the data I had added.
    To find the autorecovered file I followed the instructions here: How to find a lost file in Microsoft Office Autorecovery
    But now I cannot open the file without seeing the following error code. This happens even if I change the file type listed in the previously mentioned tutorial.
    Help!! How do I open the file!?

    Well, at least have a soundtrack for my misery now.

  • On a web page when I open a pdf file it says download on the window and then suddenly starts opening multiple firefox blank pages I cant stop it except by using force quit - help

    multiple blank firefox pages open one after the other, can't stop them. only solution is to use "force quit" I am on an iMac. Never had this until today. Has happened now 3 times! its scary/
    == This happened ==
    Just once or twice
    == I clicked to open a pdf file on a web page (i've done this many times before on this web page with no problem) ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    See [[Firefox keeps opening many tabs or windows]]
    You can have infinite tabs opening if you have selected Firefox as the application to handle a file if you get an ''Open with'' download window.
    Firefox should not be selected as the application to handle a file and you have to remove the action that is associated with that file type.
    You can delete [http://kb.mozillazine.org/mimeTypes.rdf mimeTypes.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to reset all actions or set that action in Tools > Options > Applications to 'Always Ask'.
    See http://kb.mozillazine.org/File_types_and_download_actions ("File handling in Firefox 3 and SeaMonkey 2" and "Reset Download Actions")

Maybe you are looking for

  • WAMP and Flash Media Server

    I currently have WAMP(Windows, Apache,MySQL,PHP) installed as my primary server; I do not want to change this. What I would like to do is use Flash Media Server as my primary streaming server and be able to host media files on it. I have been informe

  • Need info before switching to Apple from Windows

    I am looking at a laptop and need to run some windows based programs. I understand that Virtual PC is designed for that. However, I have two GPS programs, neither is Apple compatible. I use a Garmin for my motorcycle and Delorme for my laptop in my t

  • Search message body returns empty

    I have deleted global-messages-db.sqlite and re-indexed my mail. It is an imap account. I have "Search subfolders" and "Run search on server" checked. I get empty results when searching (Body: Contains: "my search query") I am searching for text that

  • HELP! All my songs have vanished

    I switched on my pc yesterday and clicked on itunes and when it opened i found that all 5006 tunes in my itunes to be gone including all my playlists. They're in the pc somewhere but itunes isn't recognising them for some reason. It was working fine

  • Where can I download iTunes older than 7.5?

    I downloaded/installed iTunes 7.5 when I was asked to at the iTunes store, only to discover that it won't run on my OS 10.4.1. How can I can I get my old version of iTunes back or dowload an older version. thanks! -Annabelle