0

Hi,

I'm generating word doc on the fly by using html in asp .net with C#. And I want to add image at top but after creation of word doc I'm not able to see that image. I don't want to use Word or any third party dll.
Please Help me out

Below is code snippet :

strinv = "<html>" +

               "<body>" +
 "<div><img src=" + "SnH.JPG" + "alt=" + "Spencer N Hills" +/> </div><br/>" +
               "<p style=" + "background-color:Silver; border-width:medium; border-style:ridge; border-color:Gray;" + ">" + firstname + middlename + lastname + "</p><br />" +
               "<p> Position:" + designation + "</p><br />" +

.....................
......................

 "<p>" + experience + "</p><br />" +
               "</body>" +

               "</html>";

        string textfilename = firstname.Trim() + "_" + middlename.Trim() + "_" + lastname.Trim() + "_" + "SnH.doc";
        System.IO.StreamWriter owrite;
        owrite = System.IO.File.CreateText(Server.MapPath("~/Resume/Temp/") + textfilename);
        owrite.Write(strinv);
        owrite.Close();

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Lokesh_S
0

Hi,
My hosting provider is not supporting Microsoft word library or Interop word or any other dll. So Please help for same way to code.(generate doc on the fly)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.