How to create and use Word object of office 2003 in VB.NET 2005/As

P

Patel Mitesh

Hi All,

As you all guys know How to create word object in VB.NET 2003 using
different version of Office as mention below.

'office xp
Dim wordApp As Word.Application
wordApp = CreateObject("Word.Application")
'office 2000
Dim wordApp As Word.Application
wordApp = New Word.Application
'office 97
Dim wordApp As Word.ApplicationClass
wordApp = New Word.Application

I developed one application in VB.NET 2003 to open a word object and I have
office 2003 installed in my pc. I declare word object
Dim objword As Word.Application
objword = CreateObject("Word.Application")
and it works fine in VB.NET 2003.

Now i want to transfer same code to VB.NET 2005 but it gives me error
"Cannot creat ActiveX Component" at the first line of declaration of word obj
(Dim objword As Word.Application).

So How i declare word object of Office 2003 in Vb.NET so I remove error from
my application.

Note: i include the reference of Word COM library in this project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top