Lennie Kuah

Lennie Kuah

  • NA
  • 29
  • 0

C#NET2008 problem with Microsoft WORD 2003

Oct 10 2010 3:50 AM

Hullo my Good Friends,
I need your help again. Please help me.
I am trying to use C#NET2008 and Microsoft WORD 2003 to develop Window Application  to print the Sales Transaction statement. But it not working.
This coding create the error message list below

 objWord = new Microsoft.Office.Interop.Word.Words();  <--- Error

 

Error Message:

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

 

Here are the coding:

 

using Microsoft.Office.Core;

using Microsoft.Office;

using Microsoft.Office.Interop.Word;

 

namespace CSharpDelegatePractice

{

    public partial class FrmCustomerMaint : Form

    {

          private Microsoft.Office.Interop.Word.Words  objWord;

          private Microsoft.Office.Interop.Word.Document  objDoc;

 

      private void WordToolStripMenuItem_Click(object sender, EventArgs e)

        {

            string strsql = "Select * from TblSales where SalesID = " + txtSalesID

            objWord = new Microsoft.Office.Interop.Word.Words();  <--- Error

            objDoc = new Microsoft.Office.Interop.Word.Document();

        }

   }

}     

 


 
Please help me. Thank You.
Cheers,
Lennie

Answers (2)