none
Problem in adding image in word doc in C# RRS feed

  • 常规讨论

  • 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("~/Resu

    me/Temp/") + textfilename);
            owrite.Write(strinv);
            owrite.Close();


    Thanks,
    Lokesh
    2010年1月28日 10:25

全部回复

  • Hi,

    To ensure your question could be read and answered as soon as possible, please post it in Office or ASP.NET forum.
    Additionally, this is a Chinese forum, many people here may not use English and would skip your thread.

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    2010年2月2日 6:23
    版主