locked
Add image on word doc in Header RRS feed

  • Question

  • User1703251055 posted

    Adding image as in header and "copy rights.... and page number message in footer.

              Below is my code snippest, in that I want add image in header and footer

    StringBuilder strBuilder = new StringBuilder();
    strBuilder.Append("<h1 title='Header' align='Center'>
    Writing To Word Using ASP.NET</h1> "
    .ToString());

    strBuilder.Append("<br>".ToString());
    strBuilder.Append("<table align='Center'>".ToString());
    strBuilder.Append("<tr>".ToString());

    strBuilder.Append("<td style='width:100px;color:green'>
    <b>amiT</b></td>"
    .ToString());

    strBuilder.Append("<td style='width:100px;color:red'>
    India</td>"
    .ToString());
    strBuilder.Append("</tr>".ToString());
    strBuilder.Append("</table>".ToString());

    string strPath = Request.PhysicalApplicationPath
    + "\\document\\Test.doc";

    //string strTextToWrite = TextBox1.Text;
    FileStream fStream = File.Create(strPath);
    fStream.Close();
    StreamWriter sWriter = new StreamWriter(strPath);
    Writer.Write(strBuilder);
    sWriter.Close();

    }

    Thanks for any help

    Thursday, February 10, 2011 2:33 AM

Answers