Exemple #1
0
 /// <summary> 执行 Word 的外部命令 </summary>
 /// <param name="assemblyPath">外部命令所对应的dll的绝对路径</param>
 /// <param name="externalCommand">此命令必须是实现了 IExternalCommand.Execute </param>
 /// <param name="WordApp">作为Execute()方法的输入参数的对象,表示当前的Word Application </param>
 /// <remarks>出于调试的即时更新的考虑,这里在每一次调试外部命令时,都对最新的dll进行重新加载。</remarks>
 public static void InvokeExternalCommand(string assemblyPath, IWordExCommand externalCommand, Application WordApp)
 {
     ExCommandExecutor.RunActiveCommand(externalCommand, assemblyPath, WordApp);
     //
     _currentExternalCommandAssemblyPath = assemblyPath;
     _currentExternalCommand             = externalCommand;
 }
Exemple #2
0
        private void RunExternalCommand(TreeNode ndCommand)
        {
            var exCommand            = ndCommand.Tag as IWordExCommand;
            AddinManagerAssembly asm = ndCommand.Parent.Tag as AddinManagerAssembly;
            //
            string assemblyPath = asm.Path;

            ExCommandExecutor.InvokeExternalCommand(assemblyPath, exCommand, _WordApplication);
        }
Exemple #3
0
 public static void LastExternalCommand(Application WordApp)
 {
     ExCommandExecutor.InvokeCurrentExternalCommand(WordApp);
 }