如何在 Word 文档中包含 sharepoint 版本列的值?

发布于 2024-08-20 19:13:18 字数 346 浏览 4 评论 0原文

我正在尝试找出一种方法,将 SharePoint 中版本列的内容(即每次签入文件时都会更改的值)显示为 Word 文档内的字段(或类似内容)。

理想情况下,我想知道如何配置 SharePoint,以便我可以单击“插入 > 快速部件 > 文档属性 > 版本”之类的内容,它将在文档中包含版本。目标是让人们更轻松地将文档的打印版本与 SharePoint 的版本历史记录关联起来。

已经能够向文档内容类型添加可编辑文本列,并将它们显示为文档属性快速部分。我还能够添加一个计算列,该列以文本字符串的形式获取版本...但是此计算列没有在 Word 中作为文档属性显示。 (也许我缺少计算列上的设置)

I'm trying to work out a way to display the contents of the version column from SharePoint (i.e. the value that changes every time a file is checked in) as a field (or something similar) inside of a Word document.

Ideally, I'd like to know how to configure SharePoint so I could click something like "Insert > Quick Parts > Document Property > Version", and it would include the version in the document. The goal is to make it easier for someone to correlate a printed version of a document with the version history of SharePoint.

I have been able to add editable text columns to the Document content-type and have them show up as document property quick parts. I've also been able to add a calculated column which gets the version as a text string... however this calculated column isn't showing up in Word as a document property. (Perhaps I'm missing a setting on the calculated column)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

夏见 2024-08-27 19:13:18

这是在文档中获取版本的一种方法,让它工作有点痛苦...

  • 在文档库上启用版本控制和内容类型。
  • 进入文档库设置并选择您希望该版本出现在的内容类型。
  • 从内容类型菜单中选择信息管理策略设置。
  • 选择定义策略并单击 。
  • 单击“启用标签”复选框,
  • 不要选中“标签”部分中的其他两个框。
  • 在“标签格式”字段中,按以下格式输入元数据字段:

    <前><代码> 版本:{版本} \n

  • 设置标签外观并单击预览。

  • 单击页面底部的 。
  • 返回库并使用您已修改的内容类型创建一个新文档。
  • 将文件另存为 Word 2007 格式。
  • 选择插入选项卡
  • 从功能区菜单中选择快速部件并将鼠标悬停在文档属性上
  • 从属性列表中选择标签
  • 这应该将标签中定义的元数据显示为 Word 文档中的字段。当您下次打开文档时,该字段将自动更新。
  • 节省。

This is one way to get the version in your document, it's a bit painful to get it working...

  • Enable versioning and content types on your document library.
  • Go into document library settings and select the content types you want the version to appear in.
  • Select Information management policies settings from the content type menu.
  • Select define a policy and click .
  • Click on the 'Enable Label' Check box
  • Do not Check the other two boxes in the Labels section.
  • In the Label Format field, enter the metadata fields in the following format:

     Version : {Version} \n
    
  • Set the label appearance and click on preview.

  • Click at the bottom of the page.
  • Go back to the library and create a new document using the content type you have modified.
  • Save the file as a Word 2007 format.
  • Select the insert tab
  • Select Quick Parts from the Ribbon menu and hover over document property
  • Select Label from the properties list
  • This should display the metadata defined in your label as a field in your word document. The field will update automatically when you next open the document.
  • Save.
写下不归期 2024-08-27 19:13:18

这需要配置 SharePoint 和 Word 文档。


配置 SHAREPOINT 的文档库

  1. 转至您计划存储版本控制文档的文档库。
  2. 点击设置>文档库设置
  3. 单击“版本控制设置”,并确保您选择“创建主要版本”或“创建主要和次要(草稿)版本”。
  4. 单击“确定”。
  5. 单击“信息管理策略设置”
  6. 如果您的图书馆可以处理多种内容类型,您将看到它们的列表。单击“文档”。如果它只能处理一种内容类型,请跳过此步骤。
  7. 选择“定义策略...”并单击“确定”。
  8. 选中“启用标签”框,但不要选中该部分中的其他两个框。
  9. 在“标签格式”框中输入 {Version}
  10. (可选)您可以设置版本标签的格式。
  11. 单击“刷新”按钮可查看版本标签的预览。它会显示类似 {_UIVersionString} 的内容。
  12. 当您对标签的外观感到满意时,请单击“确定”。
  13. 要返回文档库,请单击页面顶部面包屑路径中的文档库名称。

配置您的 WORD 文档:

  1. 在库中创建一个新文档或上传一个文档。
  2. 打开文档并进行编辑。
  3. 将光标放在您想要显示版本标签的位置。
  4. 转到插入>快速零件>文件属性>标签
  5. 版本标签“{_UIVersionString}”将显示在文档中。
  6. 保存文档(并选择下一个版本应该是什么)。你都准备好了!
  7. 如果您想测试它,请关闭文档并重新打开它。更新的版本将自动出现在您放置版本标签的位置。

这些说明基于埃尔文的回答。

This requires configuring both SharePoint and your Word document.


TO CONFIGURE SHAREPOINT'S DOCUMENT LIBRARY:

  1. Go to the document library where you plan to store your version-controlled documents.
  2. Click on Settings > Document Library Settings
  3. Click on "Versioning settings" and make sure that you're either having it "create major versions" or "create major and minor (draft) versions".
  4. Click OK.
  5. Click on "Information management policy settings"
  6. If your library can handle multiple content types, you'll see a list of them. Click on "Document". If it can only handle one content type, skip this step.
  7. Select "Define a policy..." and click OK.
  8. Check the "Enable Labels" box, but don't check either of the other two boxes in that section.
  9. Type {Version} into the "Label format" box.
  10. (Optional) You can format the version label.
  11. Click on the "Refresh" button to see a preview of your version label. It will say something like {_UIVersionString}
  12. When you're satisfied with the label's appearance, click OK.
  13. To get back to your document library, click on the document library's name in the breadcrumb trail at the top of the page.

TO CONFIGURE YOUR WORD DOCUMENT:

  1. Either create a new document in the library or upload one.
  2. Open the document and edit it.
  3. Put the cursor wherever you want the version label to appear.
  4. Go to Insert > Quick Parts > Document Property > Label
  5. The version label "{_UIVersionString}" will show up in the document.
  6. Save the document (and choose what the next version should be). You're all set!
  7. If you want to test it, close the document and reopen it. The updated version will automatically appear where you put the version label.

These instructions were based on Erwin's answer.

原谅我要高飞 2024-08-27 19:13:18

我按照雷切尔的指示进行,效果很好。但是,如果您想要进行电子签名,在文档中捕获此版本更新确实会产生问题。例如,如果您的版本是 1.6 并且您决定这是供人们签名的版本;您会发现,当他们签名时,文档将保存为版本 1.7。当您再次打开文档时,1.7 版本将与授权的 1.6 版本不匹配,并且您将被告知所有签名均无效。

I followed Rachel's instructions and they worked great. However, capturing this version update in the document does create a problem if you want to do electronic signatures. For instance, if your version is 1.6 and you decide this is the one for people to sign; you'll find that when they sign it, the document will be saved as version 1.7. When you open the document again, the version 1.7 will not match the authorized version of 1.6 and you'll be informed that all the signatures are invalid.

眼中杀气 2024-08-27 19:13:18

重要的:
在 SP2010 中,当在信息管理策略设置下的文档库中启用标签时,无法另存为网站模板。文档库将被损坏,即使我们禁用该策略,另存为站点模板功能仍然会被破坏。唯一的选择似乎是永久删除并重建列表。

IMPORTANT:
In SP2010 you cannot save as a site template when Labels are enabled within a document library under Information management policy settings. The document library will get corrupted and even if we disable the policy, the save as site template function is still broken. The only option seems to be to permanently delete and rebuild the list.

断念 2024-08-27 19:13:18

我认为 jaloplo 所指的 RevNum 字段与 SharePoint 文档版本号不同。每次保存文档时它都会更新,但似乎保留自己的修订编号系统,与 SharePoint 版本编号系统相关(但独立)。

The RevNum field that I think jaloplo is referring to is not the same as the SharePoint document version number. It updates every time you save the document, but seems to keep its own revision numbering system, correlated to (but independent of) the SharePoint version numbering system.

聚集的泪 2024-08-27 19:13:18

尝试在自定义内容类型中创建计算字段。该字段可以等于版本。这将使您能够将其添加为文档中的属性。这只适用于 Office 2007 文档。

创建自定义内容类型后,您可以根据该内容类型创建新文档。
创建文档后,您可以提取文档信息面板并保存。它是一个信息路径表单,因此您可以根据需要对其进行自定义,并将自定义面板上传到内容类型。

Try creating a calculated field in a custom content type. The field can be equal to the Version. That will give you the ability to add it as a property in the document. This only works well with Office 2007 docs.

Once a custom content type is created, you create a new document based on the content type.
After creating the document, you can extract the document information panel and save it. It is an info path form, so you can customise it if necessary and upload the customised panel to the content type.

飘逸的'云 2024-08-27 19:13:18

埃尔文的回答是正确的,但我想留下这个,以防有人遇到与我相同的问题。如果您尝试在网站集内容类型而不是文档库级别设置版本标签,您将收到错误“无法找到标签引用版本”。预览或保存信息策略时。此外,如果您之前已在网站集内容类型级别定义了策略,则您将无法在文档库级别保存策略。它必须在网站集内容类型上设置为“无”。也许从一开始对我来说就应该是显而易见的,但事实并非如此,也许这会帮助其他人。

Erwin's answer is spot on, but I wanted to leave this in case someone runs into the same issue I did. If you attempt to set the label for version on the site collection content type rather than at the document library level, you will get the error "The label reference, Version, could not be found." when previewing or saving the Information Policy. Also, you will be unable to save a policy at the document library level if you have previously defined one at the site collection content type level. It must be set to "None" on the site collection content type. Probably should have been obvious to me from the start, but it wasn't, and maybe this will help someone else down the line.

风铃鹿 2024-08-27 19:13:18

文档库的所有列都是 Word 文档的文档属性。要获取文档的版本,您必须显示文档属性,然后选择“高级属性”。此时,您将看到经典的文档属性窗口,并且您可以在最后一个选项卡中看到“版本”属性。

因此,您可以将此属性的值添加到文档中所需的位置,例如页脚。

All columns of a document library are document properties for a word document. To take the version of the document you have to show document properties and then select "advanced properties". In thit moment, you'll see the classic document properties window and you can see the "Version" property in the last tab.

So, you can add the value of this property to your document in the place you want, for example, the footer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文