Problem opening word doc if folder or file contains space

Hi All,
I am writing a program to open a word doc.The code i wrote is as follows
try {
Runtime.getRuntime().exec("c:\\program files\\Microsoft Office\\Office\\Winword.exe"+" file:\\\\"+path);
} catch(Exception ex) {
System.out.println(ex);
the variable path will contain
C:\My Documents\abc.doc
if the folder name or file name contains space in between, the word document will not open.It gives an error saying
trying to open C:\My\ couldn't find the file.
otherwise(if folder or file name doesn't contain space) it works fine.
So how do i overcome this problem?
Regards
S S Kurgod

Just a guess, but since it's based on the file protocol, you could try replacing the spaces in the path variable with %20%

Similar Messages

  • Problems opening Word docs with form function

    Does anyone know how to open a Word doc & keep the forms function? I have to fill out quarterly reports. When I open this type of Word doc, Pages eliminates the checkboxes and text boxes. A pain point, but Word doc is still usable.

    Hi,
    Since the issue only occurs to Word for Mac, I'm not familiar with the mechanism how it opens a file, we mainly supports Office for Windows in this forum. Please post the question in Office for Mac forum for further assistance:
    http://answers.microsoft.com/en-us/mac
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Problems opening word doc that used to open fine in previous pages

    Hello all I have perusing the forum to find out if someone had a solution. I have some word documents that I no longer can open. I do not know if it is pages 08 that is the culprit or leopard but I cannot find a way. I can see the pages in outlook, I can open them with text edit and loose all tables formating (not a good alternative right now) but I cannot open them in pages. I really do not want to reinstall word 04 as I prefer to use mac programs to any microsoft. If someone can tell me what to do I would appreciate it.
    I have done the get info open file with... to no avail.
    thanks in advance
    Mireille

    Hi everyone, I just found the solution to the problem and I am posting it here to help others who may have the same problem.
    My files were on a disk and when I copied them on the computer itself they opened without difficulties. I am not sure why. If you know please explain it to me.
    Thanks
    Mireille

  • HT1338 Having a problem opening Word doc after they are downloaded.

    I am not able to open my word documents after they are downloaded. I can old open it in preview and text edit but not works. Please help

    only* word*

  • Strange problem when opening word doc situated in WLS virtual dir

    Hi all,
    we have a strange problem when opening word doc
    situated in C:\Oracle\Middleware\as_1\forms\webutil
    we put some word docs there and tried to open from forms using for example web.show_document('http://wp0606:9001/forms/webutil/mug00103.doc', '_blank');
    no problem using FF, however in IE8 the word doc is shown in its binary format, this also happens when we try to open the doc in IE8
    however when we google and search for instance for a test.doc and then click on this url a file save dialog is shown
    that's why we believe that this might be due to a configuration issue of WLS
    any help would be greatly appreciated
    Kr
    Martin

    I think you have 2 ways to go here. Figure out what html is from wherever weblogic gets it, meaning you have to delve into the docs, snoop
    around in directories and find what it must be sending (This is going to be unavoidable if you are going to change what weblogic is doing.
    Sooner or later you have to try to figure out where it gets this stuff from)
    or
    you can experimentally snoop on your url with a tool like wget or curl. These are fundamental web tools.
    The latter is always a useful thing to be able to do. (you need to formulate a query to get the content-type).
    Whoever managed to get weblogic to serve any files in the first place probably can figure this out.

  • Can't open Word docs after updating to Pages 5.1

    Can't open Word docs after updating to Pages 5.1. Have newest Mavericks OS.

    I could open .doc and .docx files when I originally purchased Pages 4.3 in July 2013. After software was updated to 5.1 January 2014 I can no longer open any .doc or .docx files. Now, when I try to open one, is says for example: "PET.doc" can't be opened.
    **You, know what? I just tried to save a pages document and it won't even let me do that. Saying I don't have permission to move. I double checked my sharing & permissions and that's not the problem. I can't even export the file to anything else (pdf, word, etc). Says the same thing: "Document.pages couldn't be moved because you don't have permission to access folder. To view or change permissions, select the item in the Finder and choose File > Get Info."
    So it seems the entire app is crap. Although like I said it worked fine pre-update.

  • Is it possible to add a word doc (as a separate file) in Captivate?

    This could help to satisfy 508 compliance. This is in addition to the closed captioning feature, which I plan to incorporate.
    FYI - I used Articulate Presenter in the past and was able to attach a Word Document, which user was able to access via link.
    It would be nice to have a word doc incorporated into the stand-alone Captivate outpout.
    Thanks!
    Share

    Hi Share,
    Welcome to Adobe Forums.
    You can add a word doc in Captivate as a separate file.
    On a button or click box you can select the Action to "Open URL or File" and then type the name of the word doc in URL box. After publishing the output paste the word doc in the output folder and this will open the word doc as a separate file from the button.
    Thanks
    Vikas

  • How can I open Word docs with Pages?

    I just installed the iWorks software because it said it would open Word docs. Now I can't seem to open any Word .doc files I had archived onto CDs, after abandoning my PC.
    I've made Pages my default application for opening text, and that didn't help. I just keep getting the error message "The document "X.doc" couldn't be opened." Any ideas?
    IMAC   Mac OS X (10.4.8)  

    Welcome to Apple Discussions Paul
    Pages - the word processing/page layout application in iWork (no "s") - usually doesn't have any problems with opening Word files, but I do believe it can't open any Word files older than version 6. It is also highly unlikely that it would be able to open any from the new 2007 version. If your documents are from a version in between those, they should open.
    How are you trying to open them? There are at least three common methods, but, since you say the documents are on a CD, I suggest copying them from the CD to your hard drive first. To open one at a time you can use File > Open (where > means following menu commands with your cursor). To open more than one at a time, select the ones you want by Command- (⌘) clicking the files & then dragging them onto the Pages icon in the Dock or a Finder window or Control- or right-click & choose Pages from Open with in the contextual menu that appears.

  • Can't open Word docs with Pages 08

    Since upgrading to SL I found that I can no longer open Word documents sent to me via email attachments. Can this be remedied? I thought Macs were able to "translate" Word files.
    Help!

    I did discover I can open Word docs with Text Edit, but it's a multi-step process now. I really don't want to upgrade to iWork 09 and I'm not sure that would solve the problem. I also have to use Quick Time now to open movies in iPhoto. Another multi-step process. I'm not very happy with SL.

  • Open Word docs with the new Pages?

    Pages does not open. I had the new one installed but apparently had the old one still up. How can I open Word docs with the new Pages?

    Pages 5 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.01 can not open Pages 5.1 files and you will get the warning that you need a newer version.
    Pages 5 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Once opened and saved in Pages 5.1 files can not be opened in Pages 5.
    Anything that is saved to iCloud is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed over 95 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Archive/trash Pages 5, after exporting all Pages 5 files to Pages '09 or Word .docx, and rate/review it in the App Store, then get back to work.
    Peter

  • How to open word doc. from forms 10g

    hi all
    i am trying to open word doc. from forms 10g using ole2.
    but it is not working.
    basiccaly this command is not working
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    can anybody help
    thanx

    I found this searching this forum and it works..however, my issue is to open up Microsoft Word passing in data from a query.
    I am working on Forms 10g
    DECLARE AppID PLS_INTEGER;
    BEGIN
    AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\OFFICE11\winword.exe C:\test.doc',
    DDE.APP_MODE_NORMAL);
    END;

  • Can't open word docs in pages 08

    recently upgraded to snow leopard then installed iwork 08. can't open any word docs using pages 08 or excel docs using numbers 08 upgraded to x.0.3 versions and repaired disc permissions. Help anyone!

    I did discover I can open Word docs with Text Edit, but it's a multi-step process now. I really don't want to upgrade to iWork 09 and I'm not sure that would solve the problem. I also have to use Quick Time now to open movies in iPhoto. Another multi-step process. I'm not very happy with SL.

  • Open office won't open word docs automatically

    I downloaded Openoffice.org to open word docs. When I click on internet Word docs they don't open right away, I have to download to folder then open in Open org, is there way to set it up so it automatically opens it up or do I need download Word?

    Hello Psychteacn,
    The following article describes the process involved in associating particular document types with an application.
    OS X Mavericks: Choose an app to open a document
    http://support.apple.com/kb/PH14279
    Cheers,
    Allen

  • Can you open word doc. In pages? (Opening a doc. From the web) in the iPad or iPod tuch?

    Can you open word doc. In pages? (Opening a doc. From the web) in the iPad or iPod tuch?

    NH,
    This may seem a fine point, but iWork apps don't actually Open Office apps. They Import them. The reason I make this distinction for you is that when you view the result of the import, you may see some variations from what was in the Office document because of an imperfect translation, and when you make edits, you are editing an iWork document, not the original Office document.
    Jerry

  • Opening word docs in pages

    Hi
    I have just upgraded from an 8 year old imac to a brand new one, and have decided to use pages, instead of Office for mac which I used previously on the old mac, but I am have great difficulty in opening word docs in pages.
    I have selected a .doc, gone to get info,then open with, pages( default ), then change all, then try to open a word doc, which results in, unable to open.
    I must be doing something wrong, hence I would be grateful for any assistance.
    Many Thanks

    You need to uninstall the iWork trial. Read second post  on this link http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=105&highlight=reinst all&mforum=iworktipsntrick

Maybe you are looking for