Convert Word Doc to Other Formats in NPOI

Microsoft Word - Conversion to Other Formats

Documents can be converted to other formats using Save As option in File menu.

Aspose.Words - Convert Word Doc to Other Formats

Converts a whole document from DOC to other formats using default options.

C#

 Document wordDocument = new Document("Convert Word Doc to Other Formats.doc");
 wordDocument.Save("data/Convert Word Doc to Other Formatsblank.docx", SaveFormat.Docx);
 wordDocument.Save("data/Convert Word Doc to Other Formatsblank.bmp", SaveFormat.Bmp);
 wordDocument.Save("data/Convert Word Doc to Other Formatsblank.html", SaveFormat.Html);
 wordDocument.Save("data/Convert Word Doc to Other Formatsblank.pdf", SaveFormat.Pdf);
 wordDocument.Save("data/Convert Word Doc to Other Formatsblank.text", SaveFormat.Text);

NPOI HWPF XWPF - Convert Word Doc to Other Formats

C#

  XWPFDocument  wordDocument = new XWPFDocument( new FileStream("Convert Word Doc to Other Formats.doc", FileMode.Open));
  using (FileStream sw = File.Create("data/Convert Word Doc to Other Formatsblank.docx"))
  {
      wordDocument.Write(sw);
  }

Download Running Code

Download Convert Word Doc to Other Formats from any of the below mentioned social coding sites:

Download Sample Code

Download Convert Word Doc to Other Formats from any of the below mentioned social coding sites: