Results 1 to 3 of 3

Thread: How to modify doc file into html all over asp net

  1. #1
    AndersonDiaz is offline Senior Member
    Join Date
    Dec 2009
    Posts
    311
    Rep Power
    3

    Default How to modify doc file into html all over asp net

    I am developing on project where I use asp.net is front end. I want to convert doc file into html using asp net but I am unable to convert doc file into html. If you are having any code from which I will able to solve this problem, and then help me to solve it.

  2. #2
    TaylorRyan is offline Senior Member
    Join Date
    Dec 2009
    Posts
    307
    Rep Power
    3

    Default

    For that we should have MS Word installed on the same server where ASP.NET is running. After this you can make reference ASP.NET project. You can get Word library by following steps:

    • In Solution window you can find your project

    • after that right-click on it and select "Add Reference"->

    • Click on COM tab

    • Now get Microsoft Word 11 Object Library

    • choose it and press OK

    • After this you can use "Word" namespace.

    • Upload your file in sample webpage.

  3. #3
    ThomasBarnes is offline Senior Member
    Join Date
    Dec 2009
    Posts
    303
    Rep Power
    3

    Default

    Code:
    protected void B1(object s, EventArgs e)
    {
    if (FileUpload1.HasFile){
    string FTSI = @"c:tempdoc";
    string FP = folder_to_save_in + FileUpload1.FileName;
    FileUpload1.SaveAs(FP);
    Word.ApplicationClass wordApplication = new Word.ApplicationClass();
    object oNO = System.Reflection.Missing.Value;
    object oFP = FP;
    Word.Document doc = wordApplication.Documents.Open(ref oFP,
    ref oNO, ref oNO, ref oNO, ref oNO, ref oNO,
    ref oNO, ref oNO, ref oNO, ref oNO, ref oNO,
    ref oNO, ref oNO, ref oNO, ref oNO, ref oNO);
    string newfilename = folder_to_save_in + FileUpload1.FileName.Replace(".doc", ".html");
    object oNF = newfilename;
    object oFR = Word.WdSaveFormat.wdFormatHTML;
    object oEN = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8;
    object oEN = Word.WdLineEndingType.wdCRLF;
    wordApplication.ActiveDocument.SaveAs(ref oNF, ref oFR, ref oNO,
    ref oNO, ref oNO, ref oNO, ref oNO, ref oNO, ref oNO,
    ref oNO, ref oNO, ref oNO, ref oNO,
    ref oNO, ref oNO, ref oNO);
    Label1.Text = "Uploaded file successfully!";
    doc.Close(ref oNO, ref oNO, ref oNO);
    }
    }

Similar Threads

  1. Adding a WMV file to an HTML page
    By HernandezOrtiz in forum General Internet Terms
    Replies: 1
    Last Post: 06-30-2010, 03:36 PM
  2. Modify .mod file extension on a JVC video
    By RogersNguyen in forum Video Card
    Replies: 1
    Last Post: 06-03-2010, 02:10 PM
  3. Modify a pdf scanned file
    By Garcíarobine in forum Software Jargons
    Replies: 2
    Last Post: 05-26-2010, 01:07 PM
  4. modify Watermark from PDF file
    By Baker Roods in forum Software Jargons
    Replies: 1
    Last Post: 03-10-2010, 08:56 AM
  5. Replies: 0
    Last Post: 12-04-2008, 12:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48