469,283 Members | 2,178 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

How To Open a Word File in MS Office 2000 using c#.net

I require the code to open a word file i MS Office 2000 using c# .net.The file is already saved at a predefine path.
May 30 '07 #1
4 2951
SammyB
807 Expert 512MB
I require the code to open a word file i MS Office 2000 using c# .net.The file is already saved at a predefine path.
See http://www.thescripts.com/forum/thre...erop.Word.html.
There maybe a problem if you only have Word 2000, so post back if the thread doesn't help. Since you have Word 2K, I would use post #2 in the thread for the code, but don't forget to set a reference to Microsoft Word x.x Object Library on the COM tab. --Sam
May 30 '07 #2
mwalts
38
See http://www.thescripts.com/forum/thre...erop.Word.html.
There maybe a problem if you only have Word 2000, so post back if the thread doesn't help. Since you have Word 2K, I would use post #2 in the thread for the code, but don't forget to set a reference to Microsoft Word x.x Object Library on the COM tab. --Sam
I tend to avoid automation of specific programs like that unless you have very specific requirements. Now you did say you wanted it to open in Word 2000, but is it a problem if it opens in the user's default .doc program?

If you use something like this

Expand|Select|Wrap|Line Numbers
  1. System.Diagnostics.Process pRun = new Process();
  2.  
  3. pRun.StartInfo.FileName = @"C:\SomePath\TheFile.doc";
  4.  
  5. pRun.StartInfo.UseShellExecute = true;
  6.  
  7. pRun.Start();
  8.  
It will open in whatever program they have that handles .doc's. Just like a double click on the file.

-mwalts
May 30 '07 #3
SammyB
807 Expert 512MB
Good point! I just assumed the Komal was going to use other Word objects. Thanks! --Sam
May 30 '07 #4
I require the code to open a word file i MS Office 2000 using c# .net.The file is already saved at a predefine path.


System.Diagnostics.Process.Start("pathname\finame. doc");
Jun 21 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Neil | last post: by
8 posts views Thread by sudha | last post: by
8 posts views Thread by ZW | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.