You can do that the following way:
using System;
using System.Reflection;
using Word;
namespace WordConsole
{
/// <summary>
/// Summary description for WordConsole.
/// </summary>
class WordConsole
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application app=new Application();
app.Visible=false;
Object o=Missing.Value;
object docFile= args[0];
_Document doc=app.Documents.Open(ref
o);
object fileName= args[1];
object format=8;//Html
doc.SaveAs(ref fileName,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
object t=true;
app.Quit(ref t,ref o,ref o);
}
}
}
Main Topics
Browse All Topics





by: bruintjePosted on 2006-03-03 at 15:08:16ID: 16099513
Hello davidlars99,
you could do this using automation but a prerequisite is that Word should be installed or do you need this without word installed?
bruintje