-1

我在从共享点编辑模板映射的快速部分中有两个自定义列。DocSigner 和 DSigneromment

在此处输入图像描述

现在我已经用 word 编写了宏代码来获取所有内置属性和自定义属性。我能够获得所有内置的文档属性,如 Author ,Title 和所有但无法使用“CustomDocumentProperties”获得该自定义列..

这是我的宏代码..

Sub ListAllProperties()

 Dim rngDoc As Range
 Dim proDoc As DocumentProperty

 Set rngDoc = ActiveDocument.Content

 rngDoc.Collapse Direction:=wdCollapseEnd

 For Each proDoc In ActiveDocument.CustomDocumentProperties 

 With rngDoc
   .InsertParagraphAfter
   .InsertAfter proDoc.Name & "= "
   On Error Resume Next
   .InsertAfter proDoc.Value
 End With

 Next

End Sub

因此,我可以从快速部分获取所有文档属性的任何代码更改。

4

2 回答 2

0

要获取来自自定义 SharePoint 列的属性值,请使用 Document 的 ContentTypeProperties 集合。

于 2016-03-18T20:38:44.860 回答
0

@bibadia 非常感谢您的贡献

这是我最后尝试的自定义属性,它可以工作......

Sub ListContentTypeProperty()

Dim signer As String

signer = ActiveDocument.ContentTypeProperties.Item("DocSigner")

MsgBox signer

End Sub
于 2016-03-21T06:53:22.310 回答