473,396 Members | 2,029 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.

Creating Word Document in ASP.NET Application

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
Nov 18 '05 #1
1 3948
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kerri McDonald | last post by:
We have an application where the user fills out many screens and when they are done, we are supposed to display the text they entered in a word or excel format. That is fairly easily accomplished...
3
by: Leonard | last post by:
I want to create a Word document that will display data from a database. I don't want to create the file on the server, I just want to stream it out directly to the user. When they click a...
7
by: Zeke | last post by:
I'm using the following code to create word document but the problem is if you go to task manager you'll see a WINWORD.EXE process is running but not the application, here is the code: ...
3
by: m3ckon | last post by:
Hi there, I can succesfully create a word doc from my asp.net page, but I have 2 issues I need to resolve in order to use it in my app: 1) Creating a table: I seem unable to create a table,...
0
by: goof1972 | last post by:
Hello All, I have a VB.NET web application (1.1 framework) that creates a new Word document through interop.word.dll. I have a Windows Server 2003 with Office XP Professional installed. I've...
2
by: tamaker | last post by:
I have a registration form where a user is able to, upon submission of the form, have their submission entered into a simple database... now Im looking to create a word document on the fly from...
0
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an...
4
by: =?Utf-8?B?QXJ0?= | last post by:
Hello, I saw this posting and it is the closest place to ask this question. I am simply trying to create a Word document from a VB application I am wrting with Visual Studio 2005. I cut a...
2
by: uamusa | last post by:
I am Dynamically generating a proposal(report) in MS Word. By default the Paragraph Alignment is "Left". For the First 6 Paragraphs I set the Alignment to "Center", and then when attempting to...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.