I have a Word document and would like to export the content including the format as RTF (or html).
Word.Application wordApp = new Word.Application();
Word.Document currentDoc = wordApp.Documents.Open("file.docx");
currentDoc.SaveAs("file.rtf", Word.WdSaveFormat.wdFormatRTF);
currentDoc = wordApp.Documents.Open("file.rtf");
Word.Range range = currentDoc.Range();
String RTFText = range.Text;
I've tried the code above, but i seem to get just the Text, without hte format.
Any ideas?
See Question&Answers more detail:os