Free Support Forum - aspose.com

How to replace Microsoft.Office.Interop.Word.Application AND Microsoft.Office.Interop.Word.Document

How do you do this with Aspose.Word

Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document doc= WordApp.Documents.Open("C:\\test.doc");

Hi Rob,


Thanks for your inquiry.

Well, Microsoft Word application can be used with C# code. You have a Microsoft Word document (.doc) and want to read it in your C# program. With the Microsoft.Office.Interop.Word assembly, you can get the contents and formatting from the document. (please see our guide on why are Aspose components a much better option than Microsoft Office Automation?)
Rob:
Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application();
This is used to instantiate an instance of Microsoft Word application. Please note that Aspose.Words for .NET doesn’t deal with the Microsoft Application; instead it is a stand alone API that you can use to perform a great range of document processing tasks. Please read the documentation here:
http://www.aspose.com/docs/display/wordsnet/Introducing+Aspose.Words+for+.NET
Rob:
Microsoft.Office.Interop.Word.Document doc= WordApp.Documents.Open(“C:\test.doc”);
I would suggest you please read the following articles on Document Overview and loading a Document into Aspose.Words’ DOM (Document Object Modal).
http://www.aspose.com/docs/display/wordsnet/Document+Overview
http://www.aspose.com/docs/display/wordsnet/Opening+from+a+File

Please let us know if you need more information; we are always glad to help you.

Best regards,