Gunti Dilip

Gunti Dilip

  • NA
  • 54
  • 74.1k

How to call a MACRO in C# ?

Jun 28 2013 6:35 AM
 Hi ,

Please help me out to slove this problem....

I Created one WINDOWS FORM in that i created two classes MultiplyMapsmacro and clsWordBuilder..
MultiplyMapsmacro
-- Class conists Macro Code...
clsWordBuilder--- Class Which calls Macro


So i am calling a macro named "MULTIPLY_MAPS_ALL" in clsWordBuilder which takes one input as PlanNum....

namespace
RC
{
   
internal class MultiplyMapsmacro
    
{
      
internal void MULTIPLY_MAPS_ALL(int PlanNum)
      {Some Set of code.....}
    }
}




namespace
RC
{
   
class clsWordBuilder
   
{
   public bool OpenDocument(string templatePath, string missingMapsInputparam1, string missingMapsInputparam2)
   {
      if ((missingMapsInputparam1 != null) || (missingMapsInputparam2 != null))
      {
         objWord.Run("MULTIPLY_MAPS_ALL", missingMapsInputparam1, missingMapsInputparam2); 
      }
   }
   }
}

Please help me out is this the right way to call a macro.
Tell me how to call a macro which takes One Input "PlanNum"....

"MULTIPLY_MAPS_ALL"--- Macro name
missingMapsInputparam1 ,missingMapsInputparam2 are the Input form the DB.....

Regards,
Dilip.

Answers (1)