是否可以使用C#(带有exe)将VBA宏插入到Word 2010中? [英] Is it possible to insert VBA macros into Word 2010 with C# (with an exe)?

查看:82
本文介绍了是否可以使用C#(带有exe)将VBA宏插入到Word 2010中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个社区问了这个问题,但没有回答。

我想知道是否可以使用C#(带有exe)将VBA宏插入到Word 2010中?



我想在办公室里为我们的同事部署一个word2010宏。这是围绕这个问题的第2至第3个问题。加载项或模块方法失败。他们很难。我需要一键式exe来将一堆宏设置为normal.dot。



谢谢

解决方案

请先阅读我的评论。



为什么不在普通模板中插入宏,有几种方法。最重要的是安全。请参阅:使用Microsoft Word模板 - 基金会 [ ^ ]



正如我所提到的,最简单的方法是替换normal.dot(使用例如zip自提取器或任何其他应用程序)。



如果你需要做一些特别的事情,我建议你去创建Word - VBA插件 [ ^ ]。

创建VBA加载项以扩展和自动化Microsoft Office文档 [ ^ ]



如果你更喜欢写COM addin,请参阅:

演练:创建您的第一个应用程序级外接程序for Word [ ^ ]

编写Word加载项 - 部分我 [ ^ ]






是的你可以试试这个:Link [ ^ ]

I asked this question in another community, but not answered.
I wonder if it is possible to insert VBA macros into Word 2010 with C# (with an exe)?

I want to deploy a word2010 macro to our co-workers in my office. This my 2rd-3th question around this problem. Add-in or module method has failed. Very difficult to them. I need one-click exe to set a bunch of macros in to normal.dot.

Thank you

解决方案

Please, read my comment first.

There are several resons why not to insert macros in normal template. The most important is security. Please, see this: Working with Microsoft Word Templates—The Foundation[^]

As i mentioned, the simplest method is to replace normal.dot (using for example zip self-extractor or any other application).

If you need to do something special, i would suggest you to create Word - VBA addin[^].
Creating VBA Add-ins to Extend and Automate Microsoft Office Documents[^]

If you prefer to write COM addin, please see:
Walkthrough: Creating Your First Application-Level Add-in for Word[^]
Writing a Word Add-in - Part I[^]


Hi,

Yes you can try this : Link[^]


这篇关于是否可以使用C#(带有exe)将VBA宏插入到Word 2010中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆