473,499 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I create a word-document from the Asp.Net?

Hi Everybody!

I have a problem. When I get a HTML of my page that I'm rendering. I need to
generate a word-document from a html. And than I have to send this
word-document to the users through e-mail. So, how can I create a
word-document if I have a html file? I created componet that allows do it.
But this component doesn't work with Asp.Net. Exception shows error that
Asp.net does't have a permitions for it. But it's a false. Asp.net can't do
the following Item:
DocumentClass d = new DocumentClass();

Below you will find a text of that exception:

Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.

Source Error:
Line 103: object visible=true;
Line 104:
Line 105: DocumentClass d = new DocumentClass();
Who knows what can I do?

Thanks a lot!

--
Sincerely yours,
Michael Tkachev.
..Net Developer
Nov 18 '05 #1
3 2065
"Michael Tkachev" <m_*******@hotmail.com> wrote in message
news:eW*************@TK2MSFTNGP12.phx.gbl...
I have a problem. When I get a HTML of my page that I'm rendering. I need
to
generate a word-document from a html. And than I have to send this
word-document to the users through e-mail. So, how can I create a
word-document if I have a html file?


Word understands HTML natively so, if you already have an html file, just
change its extension to .doc and then send it to your users. When they try
to open it, the Windows file associations will open it in Word and Word will
understand that it's an HTML document automatically and display it properly.
Nov 18 '05 #2
Thank you Mark!

I really shocked! It works fine!

Thank you again!!!

Michael

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
"Michael Tkachev" <m_*******@hotmail.com> wrote in message
news:eW*************@TK2MSFTNGP12.phx.gbl...
I have a problem. When I get a HTML of my page that I'm rendering. I need to
generate a word-document from a html. And than I have to send this
word-document to the users through e-mail. So, how can I create a
word-document if I have a html file?
Word understands HTML natively so, if you already have an html file, just
change its extension to .doc and then send it to your users. When they try
to open it, the Windows file associations will open it in Word and Word

will understand that it's an HTML document automatically and display it properly.

Nov 18 '05 #3
"Michael Tkachev" <m_*******@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP12.phx.gbl...

Michael,
Thank you Mark!
Welcome.
I really shocked! It works fine!


You can also do something similar with Excel. Just create a standard HTML
file and give it the ".xls" extension. Excel will "understand" HTML tables
and place the invidividual tablecell contents in rows and columns in a
worksheet.

Of course, it is possible to have ASP.NET interface directly with Office,
but this is not recommended because of performance issues.

However, for WinForms (as opposed to WebForms), .NET integrates really well
with Office.

Mark
Nov 18 '05 #4

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

Similar topics

4
1612
by: nicky j | last post by:
Hi, I'm sorry if this is the wrong place to ask this, please point me in the correct direction and ignore if so.. I'm trying to figure out how to run a script on my server which will go over a...
4
13593
by: Thomas Jespersen | last post by:
Hello I want to create a MSI file programmatically. Do you know of any third party .NET component which can help me with that? I'm going to use it like a self extracting zip. So it is not...
2
1909
by: Groide | last post by:
Hello, I'm crazy but I want create an editor with c# and System.Windows.Forms.RichTextBox. I have many difficult to create the effect to highlights the text and to close the tags. This is my...
9
3212
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database...
3
1379
by: Rex | last post by:
Hi - I have been looking for a solution to a particular User Interface challenge for a long time. I have not posted this question here previously - and I am now wondering if anyone can offer me...
23
7364
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
91
7677
by: jerger | last post by:
I want to help teach to a minority group in Milwaukee, so I want to create a dictionary program that translates a sentence (like a homework problem or teacher instructions), from English into Hmong....
4
2558
by: nothix9 | last post by:
Hello guys, Ive been working this for 2 days, I am required to position a string using drawstring but the problem is its dynamic and changes depending on the database or source. A quick fix I thought...
4
2937
by: Ang | last post by:
Hi, I'm writing the code to create a word doc, I referenced this link's code : http://support.microsoft.com/kb/316384/en-us But when i click the button, it will show the doc page but i want...
5
6846
by: Nitin Mahajan | last post by:
Guys Is there a way in C# to create a word object directly from a memory stream without passing that to hard disk (file stream). I think it doesn't makes sense to create a file just to read it...
0
7134
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
7014
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
7180
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
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4921
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...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.