Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 12th, 2006, 02:50 AM
Authorized User
Join Date: Jul 2005
Location: new delhi, Delhi, India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kumar_raj13
Default Problem in opening .doc file

Hello All Friends,
I am raj from New Delhi,India.

I am making a project in C# where in the Button click I am opening a .doc file.

System.Dignostics,process.start("Winword.exe","pat h of file");

Now this query Open the specified document if document has no space in it's name(hello-me.doc) but if there is space in the document name(hello me.doc) then the document doesn't opens.
Why this is happening.Is there's another way of doing this.


Reply With Quote
  #2 (permalink)  
Old March 13th, 2006, 12:57 PM
Authorized User
Join Date: Mar 2006
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts

I tried to open a document file "C:\\Test Doc.doc" using following code. It worked fine. Please checkout if it would solve your issue.
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\Test Doc.doc";
Note: This code will launch the .doc file in its default application. In my case it is MS Word.

If the system running your code has some other application, say Word Viewer, set as the default application to handle .doc files, you might need a work around to open it in MS Word.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem opening Excel Doc when using AxBrowser sroy C# 2 September 19th, 2006 06:07 AM
Opening a doc file using a jsp karthik_talasu Javascript 3 June 27th, 2006 08:02 AM
opening doc (in another server) thisgal1213 Classic ASP Basics 1 January 3rd, 2006 08:55 PM
Opening a .doc file for view Shoedat Beginning VB 6 2 June 14th, 2003 02:56 PM

All times are GMT -4. The time now is 11:12 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.