Results 1 to 4 of 4

Thread: How to convert doc file into html using aspnet?

  1. #1
    Join Date
    May 2009
    Posts
    837

    How to convert doc file into html using aspnet?

    Hi,
    I am working on project where asp.net is front end. While working in project I stopped at one place. I unable to convert doc file into html. So if you know what is process to convert doc file into html plase help me.

  2. #2
    Join Date
    Apr 2008
    Posts
    3,295

    Re: How to convert doc file into html using aspnet?

    If you want to view file in web browser, just change doc file extension into html. As per my knowledge you have to save word file with .html extension.
    I think this will help you.

  3. #3
    Join Date
    Nov 2005
    Posts
    3,026

    Re: How to convert doc file into html using aspnet?

    For converting doc file into html using asp.net we must have MS Word installed on the same server where ASP.NET is running. After this you can make reference to particular ASP.NET project. You can find Word library by following steps:
    In Solution window -> you can find your project -> then right-click on it -> now choose "Add Reference"-> click on COM tab -> now get Microsoft Word 11 Object Library ->select it -> now press OK
    After this you can use "Word" namespace.Now upload your file in sample webpage.

  4. #4
    Join Date
    May 2008
    Posts
    2,680

    Re: How to convert doc file into html using aspnet?

    use following code
    Code:
    protected void B1(object s, EventArgs e)
    {
    if (FileUpload1.HasFile)
    {
    
    string FTSI = @"c:\temp\doc\";
    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. How can we convert an Image into HTML file?
    By FullTimepass in forum Windows Software
    Replies: 5
    Last Post: 14-11-2011, 07:52 AM
  2. convert html to rtf
    By Eleazar in forum Operating Systems
    Replies: 6
    Last Post: 07-12-2010, 09:17 PM
  3. Convert PSD to HTML
    By Zool in forum Software Development
    Replies: 4
    Last Post: 20-09-2010, 01:27 PM
  4. Convert pdb to html or pdf format
    By Migueel in forum Windows Software
    Replies: 5
    Last Post: 08-05-2010, 10:49 PM
  5. Convert html document to a jpeg file format
    By AK_Chopra in forum Windows Software
    Replies: 2
    Last Post: 13-05-2009, 03:11 PM

Tags for this Thread

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
  •  
Page generated in 1,714,046,574.00047 seconds with 17 queries