Calling word Macros from .Net
By Anuraj P on September 20th, 2007 . No Comments .
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 works fine.
You can also refer link from Microsoft
http://support.microsoft.com/kb/306683