Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2006, 02:50 AM
Authorized User
 
Join Date: Jul 2005
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.


thanks........raj


rajkumar
__________________
rajkumar
 
Old March 13th, 2006, 12:57 PM
Authorized User
 
Join Date: Mar 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Code:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\Test Doc.doc";
p.Start();
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.

Sreeram





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





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