473,805 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 3208
SammyB
807 Recognized Expert Contributor
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 New Member
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 Recognized Expert Contributor
Good point! I just assumed the Komal was going to use other Word objects. Thanks! --Sam
May 30 '07 #4
altafhussain
4 New Member
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.Diagnost ics.Process.Sta rt("pathname\fi name.doc");
Jun 21 '07 #5

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

Similar topics

1
2272
by: alikhome | last post by:
Hi! May be anybody knows... I want to open word file (or Excel) from IIS server (URL) without getting security window for input Username and password. I know Username, Password and Domain. I'm trying to open with: http://domain%5cUsername:password@URL When my computer is registred in this domain - no problem. But if my computer is not from this domain I always get window for input Username, Password and Domain.
8
3038
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and whether it was docked or not. I added the following code to my "OnConnection" function but it fails with an error, "Run-time exception thrown : System.IO.IOException - Bad file name or number." With applicationObject.CommandBars("SampleToolbar")
1
481
by: Ken | last post by:
Hi, I'm trying to access the values of properties -- summary and custom without opening Word to do a cleanup op but the customer i'm doing it for only has Office 2000. I'm using c# in .net 2003 and having trouble. I've looked on msdn and can find a pia for Office xp but no mention of Office 2000. Is this possible or do will I have to go back to VS6 and do it in VB?
1
1654
by: Dave | last post by:
Hi, This is an odd ball scenario I'm sure. I've got a .Net web page that streams an XML Word document from memory. The customer didn't want to pay to upgrade their Word 2000 software to Word 2003, so they have installed the Word 2003 Viewer on the side. They didn't need edit capability so the viewer was acceptable. The problem is that when the document is opened by IE, it is displaying it using Word 2000 so the end users see a big...
10
3066
by: Neil | last post by:
An article at http://news.com.com/2100-1012-991694.html?tag=fd_top states: "XML would allow easier interchange of data generated in Office documents with back-end systems or existing Web services." As part of an Access 2000 application, I have to continually parse Word documents and store the parsings in Access tables using Automation to control Word and parse the document. Is there a way that XML would help with that? Thanks.
8
3182
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName = "C:\\test.doc"; object readOnly = false;
8
1620
by: ZW | last post by:
Hi there, I use following code to convert a datagrid data to Excel. However, if I use IE to access the page, it opens an empty excel page. If I access it by Netscape, it can open it with excel (or save it). Does any one have experience to fix the problem? // Response.ClearContent();
4
1688
by: Lyle Fairfield | last post by:
I asked this question in Microsoft.Public.Word two days ago but I have not received an answer. I believe there are Office Experts here who may be able to help. --------- "A friend has Office 2000. She is a high school student. English is not her first language. I find the "Lookup" facility in Word 2003 very useful. I think she woud
2
4439
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ApplicationClass wordApp = new ApplicationClass(); string filePath = ""; filePath = DocPath + Session + "/" + DocFile.Value.ToString();
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.