Skip to content

Tag Archives: Interop

Consuming a C++ DLL in C#

10-Jul-09

While working on my current project, I had to use some low level I/O operations, but it was difficult using C#, and I got some C++ implementations. Then I thought of creating a DLL in C++ and use it in C#, but I didn’t get any code for the implementation. So I done some searching [...]

Calling word Macros from .Net

20-Sep-07

While using Word automation with .Net sometimes it is required ti call, word macro’s from C# or VB.Net.
Here is the code to call word macros from VB.Net.

Dim WordApp As New Microsoft.Office.Interop.Word.Application
CType(WordApp, Object).GetType().InvokeMember("Run", Reflection.BindingFlags.Default Or Reflection.BindingFlags.InvokeMethod, Nothing, CType(WordApp, Object), New Object() {"helloworld"})

In the code, helloworld is the macro name.Or you can simply call WordApp.Run(“helloworld”) will also [...]