寻找在 VSTO 中使用 WPF 的教程
我需要为 MS Word 2007 创建一个非常小的插件,它需要访问数据库。我在网上读到可以在 WPF/C# 中编写用户控件(这对我有很大帮助)并将其托管在 Winforms 主机中。
但我需要开始 - 有人知道一些好的资源吗?
我需要有关以下内容的信息:
- 如何部署该事物
- 要求 - 我可以使用第 3 方 dll - 它们是否需要签名等。
- 安全性 - 我是否仅限于沙盒安全性?我需要使用 WCF 还是可以直接访问 SQL 服务器?
- Word 对象模型入门
提前致谢!
I need to create a very small add-in for MS Word 2007 which needs access to a database. I've read around the 'net that it is possible to write the usercontrol in WPF/C# (which would help me a lot) and host it inside a Winforms host.
But I need to get started - anyone know some good resources?
What I need information about:
- How to go about deploying the thing
- Requirements - can I use 3rd party dll's - do they need to be signed etc.
- Security - am I limited to sandboxed security? Do I need to go WCF or can I access an SQL server directly?
- Getting started with the Word object model
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,完全可以。几个月前我自己做了一些这样的事情,尽管我没有直接使用 SQL(尽管我认为它可以完成)。这两篇文章帮助我开始:
WPF、WCF 和 LINQ
2007年
Yeah, totally. Did a bit of this myself a few months ago, albeit I didn't go to SQL directly (although I suppose it can be done). These two articles helped get me started:
WPF, WCF, And LINQ
2007
是的,你可以这样做。
任何像样的安装程序(Wise、installshield 等)都可以解决这个问题。 VS 中的内置安装项目 +kinda+ 可以工作,但您可能会遇到限制。
下 Office 中的插件需要签名,这意味着根据定义,任何引用都需要签名。
您可以直接从 Office 插件访问 SQL Server。那里没有问题。
哇!这是一个艰巨的任务。最好的办法是获取一个示例 VSTO Word 插件来为您提供一个框架,然后开始在对象资源管理器中浏览 Word 对象模型。大多数对象都可以通过各种集合从根 APPLICATION 选项访问。
而且大多数的命名都很合理,这使得进入它相当轻松。
没有任何书籍或类似的东西可以立即推荐。 Google 一直是我在 Word/Office 开发方面的朋友。
Yes, you can do that.
Any decent installer (Wise, installshield, etc) will do the trick. The built in install project in VS +kinda+ works, but you might run into limitiations.
Addins in Office under VSTO need to be signed, which means by definition, any references need to be signed.
You can access SQL server directly from an office addin. No probs there.
Whew! that's a tall order. best thing is to grab a sample VSTO Word addin to give you a framework, and then just start browsing the Word Object model in the Object explorer. Most of the objects are accessible from the root APPLICATION option via various collections.
And most are named reasonably which makes entry into it fairly painless.
Don't have any books or such to recommend off hand. Google's been my friend in Word/Office dev.