Click here to Skip to main content
15,900,471 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDropdownlist Pin
subbu.sk10-Sep-07 23:16
subbu.sk10-Sep-07 23:16 
AnswerRe: Dropdownlist Pin
Blue_Boy10-Sep-07 23:23
Blue_Boy10-Sep-07 23:23 
GeneralRe: Dropdownlist Pin
subbu.sk10-Sep-07 23:36
subbu.sk10-Sep-07 23:36 
AnswerRe: Dropdownlist Pin
John-ph10-Sep-07 23:39
John-ph10-Sep-07 23:39 
GeneralRe: Dropdownlist Pin
subbu.sk11-Sep-07 0:29
subbu.sk11-Sep-07 0:29 
GeneralRe: Dropdownlist Pin
John-ph11-Sep-07 1:10
John-ph11-Sep-07 1:10 
GeneralRe: Dropdownlist Pin
subbu.sk11-Sep-07 1:33
subbu.sk11-Sep-07 1:33 
QuestionHow to write html text into word file in C# and ASP.net Pin
here2learn10-Sep-07 22:56
here2learn10-Sep-07 22:56 
Hi All,

i am working on a web application which saves html file(file consist only formatted text with color, headings, font etc.). i need to write this formatted text to a word file(on click of a button). i am doing it like this:-

// on click of button, i call this function.
private void write()
{
object oMissing = System.Reflection.Missing.Value;
//Start Word and create a new document
Word._Application oWord; // word application object
Word._Document oDoc; // word document object
oWord = new Word.Application();
oWord.Visible = true;
// open new word file
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);

//Insert a paragraph at the beginning of the document.
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);

// call a method setContent(), which will return string
(here string will contain html file content(text) like:-
<code><div class="ForumSig"><b>here all my formatted text will go, it can be any number of paragraphs with any type of formatting, but will have text only</b><u><b>CodeProject<b></u></div></code>
)
string tcontent = setContent();

oPara1.Range.Text = tcontent;
// write returned html content(string) to opened word file.
oPara1.Range.InsertParagraphAfter();
}

this is simply what i am doing, this opens a new word file and writes all what my function "setContent()" returns (a string representing html file content).

now problem is that it is writing that string as it is means if string is <code>

People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh, then it is writing it same way without converting it as html equivalent like it should be displayed as:-
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily Akhilesh Singh

can any of members have any good idea about how can i write it so it will come as html means all tags will be changed as html equivalent data or (content).. plz plz help me out if any one knows how to?

Thanks Akhilesh





People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
AnswerRe: How to write html text into word file in C# and ASP.net Pin
N a v a n e e t h10-Sep-07 23:03
N a v a n e e t h10-Sep-07 23:03 
GeneralRe: How to write html text into word file in C# and ASP.net [modified] Pin
here2learn11-Sep-07 2:12
here2learn11-Sep-07 2:12 
QuestionAuthentication in http handler ??? Pin
devboycpp10-Sep-07 22:52
devboycpp10-Sep-07 22:52 
Questionusing IIS Pin
duo!@#10-Sep-07 22:42
duo!@#10-Sep-07 22:42 
AnswerRe: using IIS Pin
yogesh_kumar_agarwal10-Sep-07 22:45
yogesh_kumar_agarwal10-Sep-07 22:45 
AnswerRe: using IIS Pin
John-ph10-Sep-07 23:03
John-ph10-Sep-07 23:03 
QuestionListBoxes to display information when clicking the button Pin
Oga M10-Sep-07 22:42
Oga M10-Sep-07 22:42 
QuestionProblem with back button in IE [modified] Pin
abu sundus10-Sep-07 22:40
abu sundus10-Sep-07 22:40 
AnswerRe: Problem with back button in IE Pin
Sandeep Akhare10-Sep-07 23:49
Sandeep Akhare10-Sep-07 23:49 
GeneralRe: Problem with back button in IE Pin
abu sundus11-Sep-07 3:29
abu sundus11-Sep-07 3:29 
QuestionRecommend how to use ajax ...??? Pin
devboycpp10-Sep-07 22:39
devboycpp10-Sep-07 22:39 
QuestionAddin Table in panel at runtime Pin
Fahim A Salim10-Sep-07 22:37
Fahim A Salim10-Sep-07 22:37 
AnswerRe: Addin Table in panel at runtime Pin
Abolfazl Sheikhloo10-Sep-07 22:50
Abolfazl Sheikhloo10-Sep-07 22:50 
GeneralRe: Addin Table in panel at runtime Pin
Fahim A Salim10-Sep-07 23:17
Fahim A Salim10-Sep-07 23:17 
QuestionDemonstration CD Pin
greekius10-Sep-07 22:36
greekius10-Sep-07 22:36 
AnswerRe: Demonstration CD Pin
Christian Graus10-Sep-07 23:54
protectorChristian Graus10-Sep-07 23:54 
QuestionDispose Pin
Priya S10-Sep-07 22:23
Priya S10-Sep-07 22:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.