Click here to Skip to main content
15,888,282 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Which is more secure cms in asp.net web development ? Customized cms or Third party cms(DNN,umbraco,etc) Pin
RajeeshMenoth16-Feb-15 17:03
professionalRajeeshMenoth16-Feb-15 17:03 
GeneralRe: Which is more secure cms in asp.net web development ? Customized cms or Third party cms(DNN,umbraco,etc) Pin
Dave Kreskowiak16-Feb-15 17:59
mveDave Kreskowiak16-Feb-15 17:59 
Questionnavigation method Pin
Member 1145476815-Feb-15 20:14
Member 1145476815-Feb-15 20:14 
AnswerRe: navigation method Pin
Dave Kreskowiak16-Feb-15 14:34
mveDave Kreskowiak16-Feb-15 14:34 
QuestionError code 500 Pin
Member 1101185313-Feb-15 23:50
Member 1101185313-Feb-15 23:50 
AnswerRe: Error code 500 Pin
Afzaal Ahmad Zeeshan14-Feb-15 0:01
professionalAfzaal Ahmad Zeeshan14-Feb-15 0:01 
QuestionDisplay one month's result regardless Pin
samflex13-Feb-15 4:04
samflex13-Feb-15 4:04 
GeneralHow to convert HTMl Div to word Pin
abjchr12-Feb-15 22:33
abjchr12-Feb-15 22:33 
I need to convert html div content to ms word in below code C# Microsoft.office.interop.word.htmldivision add invalid parameter error occurred.

XML
StringBuilder objStrBuilder = new StringBuilder();

            objStrBuilder.Append("<table>");
            objStrBuilder.Append("<tr>");
            objStrBuilder.Append("<td>");
            objStrBuilder.Append("HP");
            objStrBuilder.Append("<\td>");
            objStrBuilder.Append("<td>");
            objStrBuilder.Append("HP computer");
            objStrBuilder.Append("<\td");
            objStrBuilder.Append("<\tr>");

            objStrBuilder.Append("<tr>");
            objStrBuilder.Append("<td>");
            objStrBuilder.Append("HP Labs");
            objStrBuilder.Append("<\td>");
            objStrBuilder.Append("<td>");
            objStrBuilder.Append("HP computer Joy");
            objStrBuilder.Append("<\td");
            objStrBuilder.Append("<\tr>");
            objStrBuilder.Append("<\table>");
            dic.InnerHtml = objStrBuilder.ToString();
            Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
            word = null;
            try
            {
                object missing = System.Reflection.Missing.Value;
                word = new Microsoft.Office.Interop.Word.Application();
                object template = @"D:\\DS_Template11.dotx";
                word.Documents.Add(Template: ref template);
                word.Visible = true;
                object readOnly = false;

                object filename = "http://localhost:60510/tr/Default.aspx";
                Microsoft.Office.Interop.Word.Document document = word.Documents.Open(ref filename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);


              //  Microsoft.Office.Interop.Word.Section wordSectio = document.Sections;
                foreach (Microsoft.Office.Interop.Word.Section wordSectin in document.Sections)
                {
                    foreach (Microsoft.Office.Interop.Word.HTMLDivision wordSection in document.HTMLDivisions)
                    {
                        String text = "this is footer";
                        //Get the footer range and add the footer details.
                        Microsoft.Office.Interop.Word.Section s1=document.Sections.Add();                            ;
                        Microsoft.Office.Interop.Word.Paragraph p1 = document.Paragraphs.Add();

                        Microsoft.Office.Interop.Word.Range R1 = p1.Range;
                        Microsoft.Office.Interop.Word.HTMLDivision h1= R1.HTMLDivisions.Add();
                        h1.
                        R1.ContentControls=dic.
                        R1.HTMLDivisions = dic.InnerHtml;
                        //Microsoft.Office.Interop.Word.Range footerRange = wordSection.Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
                        Microsoft.Office.Interop.Word.HTMLDivision para = wordSection.HTMLDivisions.Add(dic.InnerHtml);
                        Range.Fields.Add(Range, Microsoft.Office.Interop.Word.WdFieldType.wdFieldHTMLActiveX);


modified 13-Feb-15 6:16am.

QuestionRe: How to convert HTMl Div to word Pin
Richard MacCutchan12-Feb-15 22:47
mveRichard MacCutchan12-Feb-15 22:47 
AnswerRe: How to convert HTMl Div to word Pin
abjchr12-Feb-15 22:59
abjchr12-Feb-15 22:59 
GeneralRe: How to convert HTMl Div to word Pin
Richard MacCutchan12-Feb-15 23:45
mveRichard MacCutchan12-Feb-15 23:45 
GeneralRe: How to convert HTMl Div to word Pin
abjchr12-Feb-15 23:55
abjchr12-Feb-15 23:55 
GeneralRe: How to convert HTMl Div to word Pin
Richard MacCutchan13-Feb-15 0:11
mveRichard MacCutchan13-Feb-15 0:11 
Questionhow do I insert word, pdf and text to sql database in vb.asp Pin
Shelby12312-Feb-15 14:11
Shelby12312-Feb-15 14:11 
GeneralRe: how do I insert word, pdf and text to sql database in vb.asp Pin
PIEBALDconsult12-Feb-15 14:17
mvePIEBALDconsult12-Feb-15 14:17 
AnswerRe: how do I insert word, pdf and text to sql database in vb.asp Pin
Rollin Shultz12-Feb-15 15:59
Rollin Shultz12-Feb-15 15:59 
Questioniframe is displaying the same document even I am trying to open different documents. Even in byte array is containing different bytes and number of bytes. Pin
VPSingh malhi11-Feb-15 13:58
professionalVPSingh malhi11-Feb-15 13:58 
QuestionMVC Newbie Question - Controller and View - page not found Pin
jkirkerx11-Feb-15 8:17
professionaljkirkerx11-Feb-15 8:17 
Answer[GOT IT] - got that from that Google App Pin
jkirkerx11-Feb-15 11:06
professionaljkirkerx11-Feb-15 11:06 
AnswerRe: MVC Newbie Question - Controller and View - page not found Pin
Afzaal Ahmad Zeeshan12-Feb-15 5:53
professionalAfzaal Ahmad Zeeshan12-Feb-15 5:53 
GeneralRe: MVC Newbie Question - Controller and View - page not found Pin
jkirkerx12-Feb-15 10:45
professionaljkirkerx12-Feb-15 10:45 
AnswerRe: MVC Newbie Question - Controller and View - page not found Pin
Afzaal Ahmad Zeeshan13-Feb-15 0:06
professionalAfzaal Ahmad Zeeshan13-Feb-15 0:06 
GeneralRe: MVC Newbie Question - Controller and View - page not found Pin
jkirkerx13-Feb-15 6:23
professionaljkirkerx13-Feb-15 6:23 
AnswerRe: MVC Newbie Question - Controller and View - page not found Pin
Afzaal Ahmad Zeeshan13-Feb-15 7:02
professionalAfzaal Ahmad Zeeshan13-Feb-15 7:02 
GeneralRe: MVC Newbie Question - Controller and View - page not found Pin
jkirkerx13-Feb-15 7:31
professionaljkirkerx13-Feb-15 7:31 

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.