Word Document and ASP.net

G

Guest

Dear All,

Actually I am trying to open a word document in my ASP.net application.
I
am using the following code in Form Load Event:

Dim oWord As New Word.Application
Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add

I am geting an error of Access denied. I have installed Primary Interop
Assemblies (PIAs) for Office XP and also have added reference (COM Library)
But still I am geting this error I know that I have to setup some sort of
permissions. But dont know where.

Any help would be greatly appreciated.

Cheers,
Sunil Sabir
 
T

Tom Kaminski [MVP]

Sunil Sabir said:
Dear All,

Actually I am trying to open a word document in my ASP.net application.
I
am using the following code in Form Load Event:

Dim oWord As New Word.Application
Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
oWord.Visible = True

Since this code is running on the server, what do you expect it to do?
 
G

Guest

Dear Tom,

Thanks for your reply. So what would be the solution for this.

Any help would be greatly appreciated.
 
T

Tom Kaminski [MVP]

Sunil Sabir said:
Dear Tom,

Thanks for your reply. So what would be the solution for this.

I won't offer a solution since running Office on the server in this way is
not supported. I would offer an alternative if you told me more about what
you're trying to do ...
 
G

Guest

Dear Tom,

Thanks for the reply. Actually I want to retrieve the database records and
display it
MS Word Document. Plus I want to add some extra things my Self.

Any help would be greatly appreciated.

cheers,
Sunil Sabir
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top