【发布时间】:2019-06-25 13:10:47
【问题描述】:
我正在尝试读取 SharePoint 文档库中 Visio 文件的 SharePoint 属性(如版本)。
在 Word、Excel 和 PowerPoint 中,您可以使用 VBA 通过 ActiveDocument (Word)、Workbook (Excel) 或 ActivePresentation (Powerpoint) 的属性“.DocumentTypeProperties”读取 SharePoint 属性。显示具有所有 SharePoint 属性的消息框的 PowerPoint 示例:
Option Explicit
Sub printContentTypeProperties()
Dim prop As Variant
Dim propstr$
propstr$ = ""
For Each prop In ActivePresentation.ContentTypeProperties
Select Case VarType(prop.Value)
Case 8: ' String
propstr$ = propstr$ & prop.Name & ": " & prop.Value & Chr$(10)
Case 2 To 6 Or 14 Or 17 Or 20: ' Number (numeric value)
propstr$ = propstr$ & prop.Name & ": " & Str$(prop.Value) & Chr$(10)
Case Else:
propstr$ = propstr$ & prop.Name & ": " & "NO_STRING_OR_NUMBER" & Chr$(10)
End Select
Next prop
MsgBox propstr$
End Sub
我确实在 Google、StackOverflow 上搜索了很长时间,但我找不到如何读取 Visio 文件的 SharePoint 属性。 Visio 的“Document”对象(请参阅https://docs.microsoft.com/de-de/office/vba/api/visio.document)没有属性“DocumentTypeProperties”。
是否可以使用 VBA for Visio 文件读取 SharePoint 属性?需要哪个 Visio 版本(标准版或专业版)?
【问题讨论】:
标签: vba sharepoint properties metadata visio