Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Creating Word Document in ASP.NET Application

Reply
Thread Tools

Creating Word Document in ASP.NET Application

 
 
=?Utf-8?B?Tm92aWNl?=
Guest
Posts: n/a
 
      08-17-2004
Hi all, I'm using C# in my ASP.NET application and cannot seem to access the
MS word libraries to create a word document for some reason.

I have used both of these tutorials:
http://www.dotnetspider.com/Technology/KBPages/587.aspx
http://www.codeproject.com/aspnet/wordapplication.asp

But if I follow the instructions provided in the second tutorial I just end
up with the error:
C:\myDir\myWebPage.aspx.cs(69): The type or namespace name 'Word' could not
be found (are you missing a using directive or an assembly reference?)

However, after doing some more reading in various places on the web - I
found that some people need to "use" the library in their code - so I've
tried a variety of different "using" statements - for instance:
using Word = Microsoft.Office.Interop.Word;

However, when I do the above the code simply for a long time and eventually
returns:
exception: System.Runtime.InteropServices.COMException (0x80080005): Server
execution failed at ....

from the line:
Word.ApplicationClass objWord = new Word.ApplicationClass();

At that point I was using this COM library:
Microsoft Word 11.0 Object Library

However, after some further searching online I found other people suggesting
that instead of the above COM library I should use the following COM library:
Microsoft Office 11.0 Object Library

I have tried both independently (in my list of references) and with both
included.

I don't know what I should be doing differently - it would seem that some
people must have enjoyed success using this tutorial:
http://www.codeproject.com/aspnet/wordapplication.asp

So I have to assume I have some security setting or something that prevents
me from using office from within my asp.net application - perhaps something
in my web.config?

Can anyone make any suggestions?

Thanks,
Novice
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Tm92aWNl?=
Guest
Posts: n/a
 
      08-17-2004
The problem seems to have been caused by the user being impersonated not
having sufficient privileges to use Microsoft Word. After switching to the
Administrator account I was able to create the word document without a
problem.

Thanks,
Novice

"Novice" wrote:

> Hi all, I'm using C# in my ASP.NET application and cannot seem to access the
> MS word libraries to create a word document for some reason.
>
> I have used both of these tutorials:
> http://www.dotnetspider.com/Technology/KBPages/587.aspx
> http://www.codeproject.com/aspnet/wordapplication.asp
>
> But if I follow the instructions provided in the second tutorial I just end
> up with the error:
> C:\myDir\myWebPage.aspx.cs(69): The type or namespace name 'Word' could not
> be found (are you missing a using directive or an assembly reference?)
>
> However, after doing some more reading in various places on the web - I
> found that some people need to "use" the library in their code - so I've
> tried a variety of different "using" statements - for instance:
> using Word = Microsoft.Office.Interop.Word;
>
> However, when I do the above the code simply for a long time and eventually
> returns:
> exception: System.Runtime.InteropServices.COMException (0x80080005): Server
> execution failed at ....
>
> from the line:
> Word.ApplicationClass objWord = new Word.ApplicationClass();
>
> At that point I was using this COM library:
> Microsoft Word 11.0 Object Library
>
> However, after some further searching online I found other people suggesting
> that instead of the above COM library I should use the following COM library:
> Microsoft Office 11.0 Object Library
>
> I have tried both independently (in my list of references) and with both
> included.
>
> I don't know what I should be doing differently - it would seem that some
> people must have enjoyed success using this tutorial:
> http://www.codeproject.com/aspnet/wordapplication.asp
>
> So I have to assume I have some security setting or something that prevents
> me from using office from within my asp.net application - perhaps something
> in my web.config?
>
> Can anyone make any suggestions?
>
> Thanks,
> Novice

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Word document from an ASP.NET application Bruno MAIGNAN ASP .Net 2 06-23-2010 10:18 AM
Creating a Word document from an ASP.NET application Bruno MAIGNAN ASP .Net 1 06-22-2010 09:44 AM
Creating a Word document from an ASP.NET application Bruno MAIGNAN ASP .Net 0 06-21-2010 11:34 AM
generating word document with header and footerwithout using word object. srk ASP .Net 0 04-25-2007 06:34 AM
generating word document with header and footerwithout using word object. srk ASP .Net 0 04-24-2007 01:59 PM



Advertisments