Convertering and word til html
Ok nu har jeg efterhånden forsøgt at finde rundt i microsofts interop til office og det har endnu ekke lykkedes mig at få word filer converteret til html.Her er min kode:
using System;
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
namespace wordtest
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Word.ApplicationClass app = new Word.ApplicationClass();
Word.DocumentClass doc = new Word.DocumentClass();
object missingValue = Type.Missing;
object readolny = true;
object fileName = "C:\\Test.doc";
app.Documents.Open(ref fileName, ref missingValue,
ref readolny, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue);
Console.WriteLine(app.Documents.Count);
Console.WriteLine(app.ActiveDocument.Content.Font.ToString());
object fileNames = "c:\\test.html";
object fileformat = "HTML";
app.ActiveDocument.SaveAs(ref fileNames, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue);
}
}
}
mit problem ligger hovedsageligt i at jeg ikke kan finde ud af hvad der skal med som parameter til SaveAs og jeg har absolut ikke kunne finde de rigtig information nogen steder.
Erik Modler
