MS Word内容控件有哪些好处? [英] What are the benefits of MS Word content controls?

查看:180
本文介绍了MS Word内容控件有哪些好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Office 2007带来了一个称为内容控件"的新功能. 我需要对此进行评估,看看这是否可以解决正在研究的问题.

Office 2007 brings a new goodie called as 'content controls'. I need to evaluate this to see if this serves as a solution for a problem under research.

由于时间有限和我对Office-interop-pain的普遍不屑,

Due to paucity of time and my general disdain for Office-interop-pains,

  • 有人可以总结一下好处吗?
  • 是否可以定义自定义内容控件?
  • 程序员一词(如果有的话)在哪里闲逛:)?

RTFMsdn链接也欢迎.

RTFMsdn links also welcome.

到目前为止,我(从一些截屏视频中)看到,现在可以定义 -模板字文档,其内容可以从数据隐藏XML中插入.您可以根据需要创建此XML.将数据库的内容转换为XML形式. doc一词现在可以数据绑定"到该XML.

So far I see (from some screencasts) that its now possible to define - template word docs whose content can be stubbed in from a data-behind-XML. You could create this XML as you wish.. e.g. translate contents of your DB into an XML form. The word doc can now 'data-bind' to this XML.

推荐答案

经过2天的研究,这就是我的发现.

Well after 2 days of research, here's what I found.

内容控件是旧书签的下一步发展..

Content Controls are the next step in evolution from the old bookmarks..

  1. 保护-您可以保护文档中的内容控件,以使用户无法对其进行编辑.例如合同条款可能无法像文档的其余部分一样进行编辑
  2. 数据绑定-您可以在Word文档中创建表单",其内容控件可以通过可视化设计器绑定到自定义xml. 2向:更改xml将更新doc单词中的控件,反之亦然.为您的xml放入xml模式,您也可以进行用户输入验证.内容控件可以通过XPath绑定到单个xml节点.
  3. 事件-内容控件公开了您可以处理以进行自定义处理的事件.
  4. 文档自动生成-在了解IO.Packaging命名空间,Open XML规范+ Visual Studio之后,您可以创建框架文档,然后通过以下方式生成实际文档(例如发票):提供不同的数据存储/对象(自定义xml).您也可以执行类似.net'DataTemplates'的操作-例如这是每个订单订单项的外观..针对xml中的n个订单项重复此操作
  1. Protection - you can protect content-controls in your document such that the user cannot edit them. e.g. the terms of the contract may not be editable like the rest of the doc
  2. Data binding - you can create 'forms' in a word doc with content controls that bind to a custom xml via a visual designer. 2-way: Changing the xml updates the controls in the word doc and vice versa. Throw in an xml schema for your xml and you can have user-input validation as well. Content Controls can bind to individual xml nodes via XPath.
  3. Events - content controls expose events that you can handle to do custom processing.
  4. Document auto-generation - With some knowledge of the IO.Packaging namespace, the Open XML specs + Visual Studio, You can create a skeleton document and then churn out actual documents (e.g. invoices) by supplying a different data store/object (custom xml). You can also do something like .net 'DataTemplates' - e.g. This is how each order line item should look like.. repeat this for n line items in the xml

最佳概览: http://blogs.msdn.com/kathleen/archive/2007/06/20/my-favorite-feature-word-content-controls.aspx
迈克·奥蒙德(Mike Ormond)的截屏视频- http://blogs.msdn.com/mikeormond/archive/2007/05/24/office-open-xml-file-format-nuggets.aspx

Best at-a-glance post: http://blogs.msdn.com/kathleen/archive/2007/06/20/my-favorite-feature-word-content-controls.aspx
Mike Ormond’s screencasts - http://blogs.msdn.com/mikeormond/archive/2007/05/24/office-open-xml-file-format-nuggets.aspx

这篇关于MS Word内容控件有哪些好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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