473,915 Members | 4,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

export to msword - html

hi guys I'm trying to export an aspx page to msword.

#############

I know you can do

Response.Clear( );

Response.Conten tType="applicat ion/msword";

Response.AddHea der("Content-disposition",

"attachment ; filename=myword .doc");

Response.Charse t = "";

StringWriter sw = new StringWriter();

HtmlTextWriter htw = new HtmlTextWriter( sw);

this.Label1.Ren derControl(htw) ;

Response.Write( sw.ToString());

Response.End();

############### ##

and render a control to msword. the problem is when I do this to render the
label the HTML is not converted to word xml when the ms word opens.

I assumed that it would be based on the same principle as opening a html
file in msword where word automatically converts the html file to word
format.

is it possible to do this ? atm the html is rendered as text too so I get a

<span id="Label1">tes t</span>

instead of just "test"

Thanks

Tom
Jul 21 '05 #1
0 1668

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

Similar topics

2
3968
by: Guillaume Durand | last post by:
Hi, I transform XML data in an OutputStream which is open as a word document. All works fine excepted the images defined in the xsl file which are html links (src="images/image1.jpg"). So, when I save the word document in a particular place, the image can't be displayed cause the path is no good anymore. I would like to merge the images in the word document without any external html links. Any idea?
4
1888
by: Robert | last post by:
Hello, I would like to take the data from a query and export it to an MSWord doc or dot that can display the fields. (Auto fill) I have been trying to figure out how to do this, but have not found the appropriate documentation as to how to set this up. Can someone help me out here.
0
932
by: Tom Gao | last post by:
hi guys I'm trying to export an aspx page to msword. ############# I know you can do Response.Clear(); Response.ContentType="application/msword";
1
3279
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True Response.ContentType ="application/vnd.ms-excel" 'application/msword
0
2733
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable to export reports that have linked subreports. I receive (a "Missing parameter field current value") on the following statement: Me.crReportDocument.Export() The main report requires 4 parameters. The linked reports do not require any...
1
3524
by: manmit.walia | last post by:
Hello All, I am stuck on a task that I need to complete. What I have is a SQL 2005 DB running with a Table called Docs. The table structure consists of the following: Table Structure for Docs ------------------------------------ DocID int - Primary Key ClientID int - CustomerID CreatedByUser nvarchar - UserName
2
1638
by: manmit.walia | last post by:
Hello All, I am stuck on a task that I need to complete. What I have is a SQL 2005 DB running with a Table called Docs. The table structure consists of the following: Table Structure for Docs ------------------------------------ DocID int - Primary Key ClientID int - CustomerID
1
1628
by: Cloud | last post by:
Hi all, I have a parent page(parent.aspx) which will open different new windows depending on the user input. for example, the new windows are opened using the following code : window.open('child.aspx', document.userinput.value) In the child.aspx, the result is rendered as Excel, Word, PDF, etc...
0
1572
by: nightscorpion | last post by:
Hello Everyone , im supposed to create a Customer with labels (name,add,Telnr...)and textboxes(thomas ,karsplatz,23423423423) in a windows form. i store all these data in a class (get/set methods) However the problem arises when i got to export this data into a docx format(i.e when i click on the button "import" the data from the windows form is exported to msword format) which has a table containing the contents of...
0
10039
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9881
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11354
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10542
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7256
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5943
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.