.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Ms word to HTML

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Hi all, i designed some contents from MS word then save it as web page then open that web page in browser then view source, copy this view source and paste into the AJAX Html Editor and clik the button then this content will be display in a Gridview on another page. But the problem is if i applied this content then the display page design totally collapsed. I think there is some problem with MSword to HTML conversion.. what was the problem and how to solve it?

View Complete Post

More Related Resource Links

Html editor word wrap problem

I created an html editor which uses an iframe for designing. The iframe doesnt wraps the text within it.... but the text keeps on extending in the same row towards the right. i tried setting scrolling='no' but it didnt work... tried word-wrap:break-word but thats also of no use........ please help! 

Insert html formatted text into word document asp.net(C#)

HI,I am creating an ms-word document from server side using a template. Here i add the reference Microsoft word 11.0 object library. Here i use a template where i set some bookmarks. Now i need to populate those bookmarks.Everything goes fine but i am stuck in one place where i need to write html text exceptnormal text. My code sample is as follows:            object TemplatefileName = Server.MapPath("Template") + "\\High.doc";            object novalue = System.Reflection.Missing.Value;            Word.Table oTable;             Word.ApplicationClass objWord = new Word.ApplicationClass();            Word.Document objWordDoc = objWord.Documents.Add(ref TemplatefileName, ref novalue, ref novalue, ref novalue);            objWordDoc.Activate();            objWordDoc.Application.Visible = true;   objWordDoc.Bookmarks.get_Item(ref prj_name).Range.Text = dProject.Rows[0]["txtProject"].ToString();Here its a complex report. Now in a bookmark i need to write html c

SharePoint Server 2010 - API to convert word docs to FILTERED HTML


Using word automation services, we cannot convert a doc/docx to FILTERED html, which can be done on client side using "saveas".

Is there any unexposed API through which one can achieve this using SharePointServer2010 + c# programatically.

or any alternative way to get FILTERED HTML format file from doc/docx?

I knew the way to do this as a client side application. This can be acheived simply by recording macros.

Ref: http://tudorstoian.blogspot.com/2008/02/word-automation.html

I want sharepoint 2010 server side way to do this task.

Regular expression for Ms Word HTML Markup


I am trying to create a regular expression that searchs for all html tags and attributes that start with 'mso', ending with a semi-colon.  If found, it would replace it with an empty string.

eg. Input string:

<span style="font-family: Arial, sans-serif; font-size: 11pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Times New Roman; mso-bidi-font-family: Times New Roman; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">My text goes here</span>


<span style="font-family: Arial, sans-serif; font-size: 11pt;">My text goes here</span>

All the attempts I have tried have yielded no results. I have tried: (\bmso)\w*[;]\b and this - \bmso\w+(?=;\b) among many other variations of the two.  Any help would be appreciated.


Regular expression for MS Word HTML Markup


I am trying to validate a rich text box to remove some ms word content but I want to keep the other attributes that are not MS office related.

input: <span style="font-size: 11pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: &#34;Times New Roman&#34;; mso-bidi-font-family: Times New Roman&#34;; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; font-family: Arial&#34;, &#34;sans-serif&#34;">mso-bidi-language: AR-SA; mso-My Text Here; mso-My Text Here2</span>

I first run this regex to remove the unformed html (\&\#34\;).  Then, I remove everything inside the =" ending with "

regex: (?<=\=\")(.*?)(?=\")
: <span font="" style="">mso-bidi-language: AR-SA; mso-My Text Here; mso-My Text Here2</span>

Now it removes everything inside the tags and not the text. With the following, it removes the matching pattern, but it also removes the text that i need and the end tags.

: <span font="font-size: 11pt;" style="font-family: Arial, sans-serif;">

When i try and combine the two expressions, it does not provide the correct output.

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

PrintPocketCE Print Pocket Excel, Pocket Word and email files

Version 3.560 (May 15, 2009):

Important bug fix: a slight difference in how some devices create fonts was causing a few devices to have significantly longer print times for large print jobs.

Adjusted PocketJet printer paper feed commands

Other minor fixes and enhancements.

Version 3.559 (Mar 5, 2009):

Added support for Martel MCP78xx printers

Version 3.558 (Aug 20, 2008):

Added support for Martel MCP78xx printers

Version 3.557 (June 27, 2008):

Fixed error in Canon printer support

Fixed COM0 port selection

Version 3.556 (June 15, 2008):

Added support for Brother MW-260

Added support for Sato MB400

Version 3.555 (Aug 8, 2007):

Added support for Pentax RuggedJet 3 and RuggedJet 4 printers

Changed Epson TM-P60 support to maximum page width of 1200 dots

Version 3.551 (Aug 1, 2006):

Added Peripheral Nomad printer support

Version 3.550 (Mar 23, 2006):

Added Panasonic JT-H200PR printer support

Added Pocket Spectrum printer support

Fixed problem with WM5.0 "inverted image" problem

Getting value of Html.TextBoxFor(m => m.name)


Hi All,

I am new to Asp.net MVC 2. I am unable to get value for Html.TextBoxFor(m = > m.name) in view. I can get this value in Controller.

How to get this value in view.

Please help.

MS Word style comments in asp.net



I need to create a system, that will be similar to ms word style comments. So the idea is the following: on the page there are a pack of text boxes labels and so on, and user need have the way to comment each control, and save commented text, for example to DB, so the others can reed comments too.

I tried PopUpControlExtender, but it works in single way, and i cannot view all the popups in one time. Or may be i missed something and there is a way to popup all the controls at one time? 

Therefore, are there any known solutions for a discribed task, based on PopUpControlExtender or something else?

Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


adding a url to html img


I am having an html img tag in which the user is being shown images. However I now want to open a url when the user clicks my img. 
What do I need to do to be able to achieve this? 

VS 2010 HTML validation "in CSS" option - where the hell is it?


In VS 2008 there is a very useful feature of background HTML validation - it checks if CSS class name is valid i.e. it exists in one of the linked css files. But VS 2010 Express does not do that any more. And the relevant setting in Options->Text Editor->HTML->Validation->in CSS is not there. Ok, maybe they made it paid for option? VS 2010 Professional? Not there. Or maybe VS 2010 Ultimate? Not a trace.

1. am I blind?

2. they decided it is too convenient to use and removed it?

3. they will "introduce" it in SP1?

What is going on? That one thing made me move back to VS 2008 web developer.


VWD rearranging HTML


Hey guys,

Have been VWD for a while now but VWD2010 seems to have one really annoying habbit. I'll write a whole load HTML with server tags and when I save, not always but quite often, VWD will squash all tags together in seemingly random arrangement completely removing my formatting conventions that make it easy for me to read. All the tags are still in the right order and makes no difference to how the page works, it just makes it really difficult to read quickly when scanning over it looking for a particular section.

For example:

        <asp:Panel ID="pnlConfirm" runat="server" Visible="false">
<asp:Table ID="tblConfBilling" runat="server">
<asp:Label ID="lblName" runat="server" Text="" />
<asp:Label ID="lblAddress" runat="server" Text="" />

Encoding en Decoding HTML



I stored in a database a ntext "<b>Hello</b>";

But when  I read it from the database I see <b>Hello</b> instead of Hello.

In the html source I see this: &lt;b&gt;Hello&lt;/b&gt;

Any Idea?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend