T
techie
I am trying to run a Word macro. The problem is that the parameters are
unchanged after running the macro. This shouldn't be the case because some
of the parameters to the Word macro are reference variables. This is not a
problem with the macro because it known to work fine.
Here's my code:
object oMissing = Missing.Value;
object oConfigFile = "validatorconfig.xml";
object oReturnErrors = 0, oReturnWarnings = 0;
object oReportWarnings = (Object)true;
object oCheckGlobalMinRules = (Object)true;
object oDocumentRange = (Object)m_WordDocument.Content;
object oSilentMode = (Object)false;
object oVal = m_WordApp.Run("DoParagraphValidation", ref oConfigFile,
ref oReportWarnings, ref oCheckGlobalMinRules, ref oDocumentRange,
ref oReturnErrors, ref oReturnWarnings, ref oSilentMode, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
I expect oReturnErrors and oReportWarnings to be changed (from 0) but they
are not. I can't see anything wrong with the code above.
Any help will be much appreciated.
unchanged after running the macro. This shouldn't be the case because some
of the parameters to the Word macro are reference variables. This is not a
problem with the macro because it known to work fine.
Here's my code:
object oMissing = Missing.Value;
object oConfigFile = "validatorconfig.xml";
object oReturnErrors = 0, oReturnWarnings = 0;
object oReportWarnings = (Object)true;
object oCheckGlobalMinRules = (Object)true;
object oDocumentRange = (Object)m_WordDocument.Content;
object oSilentMode = (Object)false;
object oVal = m_WordApp.Run("DoParagraphValidation", ref oConfigFile,
ref oReportWarnings, ref oCheckGlobalMinRules, ref oDocumentRange,
ref oReturnErrors, ref oReturnWarnings, ref oSilentMode, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
I expect oReturnErrors and oReportWarnings to be changed (from 0) but they
are not. I can't see anything wrong with the code above.
Any help will be much appreciated.