// using System.Reflection; nicht vergessen!
/// <summary>
/// Wandelt ein bestimmtes Word-Dokument in HTML um.
/// </summary>
/// <param name="source">Quelldokument</param>
/// <param name="destination">Zieldokument</param>
public static void ConvertWord2Html(string source, string destination)
{
// Konstante für Word-HTML-Ausgabeformat
const int WORD_HTML_FORMAT=8;
// COM-Metadaten von Word.Application aus der Registry laden
Type wordApplication=Type.GetTypeFromProgID("Word.Application");
// Neue Instanz von Word erzeugen
object word = Activator.CreateInstance(wordApplication);
// Word sichtbar machen (Visible=true)
//wordApplication.InvokeMember("Visible",BindingFlags.IgnoreCase | BindingFlags.SetProperty | BindingFlags.Public,null,word,new object[1]{true});
// Dokumentauflistung abrufen
object documents = wordApplication.InvokeMember("Documents", BindingFlags.IgnoreCase | BindingFlags.GetProperty | BindingFlags.Public, null, word, new object[0]);
// COM-Metadaten von Word.Documents ermitteln
Type wordDocuments = documents.GetType();
// Quelldokument laden
object document=wordDocuments.InvokeMember("Open", BindingFlags.IgnoreCase | BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.OptionalParamBinding, null, documents, new object[1] {source});
// COM-Metadaten von Word.Document ermitteln
Type wordDocument = document.GetType();
// HTML erzeugen
wordDocument.InvokeMember("SaveAs", BindingFlags.IgnoreCase | BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.OptionalParamBinding, null, document, new object[2] {destination,WORD_HTML_FORMAT});
// Word schließen
wordApplication.InvokeMember("Quit", BindingFlags.IgnoreCase | BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.OptionalParamBinding, null, word, new object[0]);
}