我正在尝试读取SharePoint文档库中Visio文件的SharePoint属性(如版本)。
在Word、Excel和PowerPoint中,您可以通过SharePoint (Word)、工作簿(Excel)或ActivePresentation (Powerpoint)的“.DocumentTypeProperties”属性来读取ActiveDocument属性。显示具有所有SharePoint属性的Messagebox的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
我真的搜索了谷歌,StackOverflow很长一段时间,但我找不到如何读取Visio文件的SharePoint属性。Visio的“Document”对象(请参阅https://docs.microsoft.com/de-de/office/vba/api/visio.document)没有属性“DocumentTypeProperties”。
是否可以使用VBA读取Visio文件的SharePoint属性?需要哪个Visio版本(标准版还是专业版)?
发布于 2019-06-25 23:21:38
没有从Visio文件读取(用户定义的) Visio文件SharePoint属性的API。
不过,您始终可以自己解析Visio文件。如果这些属性存在于文件中,您将能够获取它们,因为Visio文件现在只是一堆压缩的xml文件(假设文件不是旧的二进制格式)
发布于 2019-06-25 21:30:56
AFAIk没有DocumentTypeProperties
,但是您可以直接从document
对象访问标准的AFAIk。MSDN Discussion
ThisDocument.FullName
ThisDocument.TimeCreated
ThisDocument.Creator
如果您想在文档中保存一些信息,可以将它们保存在Document ThisDocument.DocumentSheet
的Shapsheet中,到目前为止,我还没有找到更好的选择。
https://stackoverflow.com/questions/56754893
复制相似问题