- using System;
-
- namespace DocConvert
-
- {
- class DoctoRtf
- {
- static void Main()
- {
- //Créer l'instance de l'Application Word
- Word.Application newApp = new Word.Application();
- // specifer la Source & distination
- object Source="C:\\aahamden\\Word2Html\\Input\\document.doc";
- object Target="C:\\aahamden\\Word2Html\\Output\\result.html";
- object o =Type.Missing;
- // Source document open here
- // Additional Parameters are not known so that are
-
- newApp.Documents.Open(ref Source,ref o, ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
- // Specier le format du fichier output
- object format = Word.WdSaveFormat.wdFormatHTML;
- //Changer le format du document
- newApp.ActiveDocument.SaveAs(ref Target,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
- // quité l'application
- newApp.Quit(ref o,ref o,ref o);
- }
- }
- }
using System;
namespace DocConvert
{
class DoctoRtf
{
static void Main()
{
//Créer l'instance de l'Application Word
Word.Application newApp = new Word.Application();
// specifer la Source & distination
object Source="C:\\aahamden\\Word2Html\\Input\\document.doc";
object Target="C:\\aahamden\\Word2Html\\Output\\result.html";
object o =Type.Missing;
// Source document open here
// Additional Parameters are not known so that are
newApp.Documents.Open(ref Source,ref o, ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
// Specier le format du fichier output
object format = Word.WdSaveFormat.wdFormatHTML;
//Changer le format du document
newApp.ActiveDocument.SaveAs(ref Target,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
// quité l'application
newApp.Quit(ref o,ref o,ref o);
}
}
}