文档信息面板属性,用于显示/隐藏Word文档中的文本范围 [英] Document Information Panel properties to show / hide text ranges in a Word document

查看:101
本文介绍了文档信息面板属性,用于显示/隐藏Word文档中的文本范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SharePoint内容类型打开带有"新建文档"命令的Microsoft Word文档。   文档信息面板(DIP)显示其关联的内容类型字段。我已经将其中一些属性
部署为快速部件,并且在文档中正确地更改了它们的使用位置。 好东西。

I'm using a SharePoint content type that opens a Microsoft Word document with the New Document command.   The Document Information Panel (DIP) shows with its associated content type fields. I've deployed some of these properties as quick parts and they correctly change within the document where ever they are used.  Good stuff.

现在,我想扩展功能,根据是否检查DIP中的某些复选框,有选择地显示/隐藏部分,表格和文本范围。  ;这可能吗? 

Now, I'd like to extend the functionality to selectively show/hide sections, tables, ranges of text based on whether certain checkboxes within the DIP are checked or not.  Is this possible? 

如果是,我不确定在此处遵循的最佳方法,无论是宏驱动还是VSTO或其他或不可能。

If it is I'm not sure of the best approach to follow here, whether macro driven or VSTO or other or not possible.

我目前的情况是管理雇佣合约及相关条款包含/排除。 该文档的大部分内容都将受到保护。 目的是简化合同的构建,并确保新合同的作者省略错误
。   合同可能需要在SharePoint和企业环境的上下文之外移植(例如,当它通过电子邮件发送给收件人时),因此需要保持其数据完整性以确保仅保留
选定的文本范围。可见 也许XPS / PDF成为确保这一点的最终控制版本。

My current scenario is for the management of employment contracts and the associated clause inclusions/exclusions.  The bulk of the document's contents would be protected.  The aim is to simplify contract construction and to ensure errors are omitted by new contract authors.   The contract may need to be portable beyond the context of the SharePoint and corporate environment (ie when it is emailed to the recipient for instance) so it will need to maintain it's data integrity to ensure only selected text ranges remain visible.  Perhaps XPS/PDF becomes the final controlled version to ensure this.

推荐答案

在文档正文中,您可以使用字段根据文档属性中的内容有条件地显示内容。这样的字段可以按以下方式编码:

In the body of the document, you can use fields to conditionally display content according to what's in a Document Property. Such a field might be coded along the lines of:

{IF {DOCPROPERTY MyProperty} =" MyValue" "如果为TRUE则显示条件输出" "条件输出显示,如果为FALSE"}

{IF{DOCPROPERTY MyProperty}= "MyValue" "Conditional output to display if TRUE" "Conditional output to display if FALSE"}

其中'MyProperty'是属性的名称,'MyValue'是您要测试的值和字段括号(即{ })通过Ctrl-F9(Mac上的Cmd-F9)在文档正文中创建;你不能简单地输入或复制&从
粘贴这封邮件。真实&虚假输出可以包括多个段落,表格和表格。图像,如果需要的话。请注意,更改文档属性本身可能不会更新文档的内容;你需要一个宏(代码简单如
ActiveDocument.Fields.Update)或手动更新,通过Ctrl-A,F9来做到这一点。

where 'MyProperty' is the name of the property, 'MyValue' is the value you want to test against and the field braces (i.e. { }) are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. The True & False outputs can include multiple paragraphs, tables & images, if needs be. Note that changing a Document Property probably won't of itself update the document's content; you'll need either a macro (with code as simple as ActiveDocument.Fields.Update) or a manual update, via Ctrl-A, F9 to do that.


这篇关于文档信息面板属性,用于显示/隐藏Word文档中的文本范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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