According to the Word Interop documentation Microsoft.Office.Interop.Word.Application is an interface, yet I am able to create a new instance of it as follows
var application = new Microsoft.Office.Interop.Word.Application();
There's also an example of this on DotNetPerls. It's normally not possible to create instances of an interface in C#, so how is it possible here? Is this a feature of COM or dynamic types?
Because this is not C# interface but a COM interface. COM interfaces are represented in C# as interfaces with ComImport and Guid attributes.
[GuidAttribute("00020970-0000-0000-C000-000000000046")]
public interface Application : _Application,
ApplicationEvents4_Event
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With