473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C#NET2008 Microsoft WORD 2003

126 100+
Hullo Good Friends,
I need your help. Please help me.

I am using C#NET2008 to develop Window application

I am trying to retrieve Sales Transaction and print it on WORD Document as statement of account.

this coding created error message listed below:
objWord = new Microsoft.Office.Interop.Word.Words();

Error message:
Error 1 Cannot create an instance of the abstract class or interface 'Microsoft.Office.Interop.Word.Words'

Expand|Select|Wrap|Line Numbers
  1. using Microsoft.Office.Core;
  2. using Microsoft.Office;
  3. using Microsoft.Office.Interop.Word;
  4.  
  5. namespace CSharpDelegatePractice
  6. {
  7.   public partial class FrmCustomerMaint : Form
  8.   {
  9.   private Microsoft.Office.Interop.Word.Words  objWord;
  10.   private Microsoft.Office.Interop.Word.Document objDoc;
  11.  
  12.  
  13.  private void WordToolStripMenuItem_Click(object sender, EventArgs e)
  14.  {
  15.   string strsql = "Select * from TblSales "
  16.   objWord = new Microsoft.Office.Interop.Word.Words();  <- Error
  17.  
  18.  objDoc = new Microsoft.Office.Interop.Word.Document();
  19.         }
  20.  
  21.    }
  22. }
  23.  
Oct 10 '10 #1

✓ answered by Anton Zinchenko

I think it should be something like this:
Expand|Select|Wrap|Line Numbers
  1. Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
  2. Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(...);

2 1964
I think it should be something like this:
Expand|Select|Wrap|Line Numbers
  1. Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
  2. Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(...);
Oct 10 '10 #2
lenniekuah
126 100+
Hi Anton,
thank you for your sample coding. That is just awesome and wonderful in sharing information with me. Appreciate that very much.

Cheers,
Lennie
Oct 11 '10 #3

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

Similar topics

5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
1
by: rkbnair | last post by:
Does anybody know what references to use in order to open a Word document from inside the vb project? In Word 2000, we can reference word..?? However, I can't see anything like Word 2003. Thanks...
2
by: Shawn | last post by:
Hi, I have added a spell checker to my web application using the "Microsoft Word Document" DCOM. Everything works great in my development environment. When I move everything over to my...
12
by: Cheval | last post by:
Has anyone had any problems with inter-office automation between MS Word and MS Access in Office 2003? I have recently installed office 2003 in a new folder and have left the older office 2000...
5
by: Bob | last post by:
I'm getting error 8007007e when executing the following code. Dim word As New Microsoft.Office.Interop.Word.Application Dim doc As Microsoft.Office.Interop.Word.Document doc =...
1
by: Dixie | last post by:
I am trying to create a registry patch to change the security setting of Microsoft Word 2003. I am working in an environment with hundreds of imaged computers which are supplied with Word set to...
1
by: Franske | last post by:
Help! I am developing a Shared Add-in for Word 2003 in Visual Studio .Net 2005. If I build this it is working fine with my Word 2007 version but installing it on my notebook with Word 2003 it is...
0
by: =?Utf-8?B?U2VhRmlyZQ==?= | last post by:
I am able to search through custom properties of a Microsoft Word 2003 file. I have yet to figure out the call to update a custom property. I receive a System.Reflection.TargetInvocationException...
2
by: djamila | last post by:
Hi, I work in a c# project that uses Microsoft Word to generate report. In my program I use Interop.Word reference. When I run the program in my PC with Microsoft Word 2003, all work well....
2
by: davidson1 | last post by:
Hello Friends, I have installed new Windows XP.I want Microsoft word 2003...Where Can I download????.I search in Google.But I could not find a Proper website..Can you Help me....Thanks in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.