Comments: ** Comment from web user: SebastianDotNet **
In NetOffice 1.7.3 you have to use the ctor from the corresponding wrapper class.
The following examples used a non-existing method called "CreateObject" which is the same like the VB6 well-known method to create a new COM class trough late-binding.
example1 - Word Application
object interopProxy = CreateObject("Word.Application");
NetOffice.WordApi.Application app = new NetOffice.WordApi.Application(null, interopProxy);
example2 - Word Document
object interopProxy = CreateObject("Word.Document);
NetOffice.WordApi.Document document = new NetOffice.WordApi.Document(null, interopProxy);
may nice to know:
I've been created some static methods in NetOffice 1.7.4 to do this easier because its a common problem for beginners. Its something like:
var managedNetOfficeWrapper = COMObject.CreateInstanceFromProxy(interopProxy);
// netoffice analyze the proxy and creates the corresponding wrapper automaticaly - you have to cast the result from the common base class COMObject to its actual type.
moreover: as far i remember, the NO 1.7.3 includes a tutorial how to face this challenge. you may give'em a try ;) ( i know, the most open-source projects doesnt spend a good explanation/documentation. I alyways try to do this better like a commercial/professional project. Its need the same time as the development - please do me pleasure and spend 5-10 minutes for the tutorials)
"The tutorials are sufficient to understand what makes NetOffice tick. Great info!"
- a customer feedback from a United States company
*Sebastian