首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何读取SharePoint文件的Visio属性(DocumentTypeProperties)?

如何读取SharePoint文件的Visio属性(DocumentTypeProperties)?
EN

Stack Overflow用户
提问于 2019-06-25 21:10:48
回答 2查看 695关注 0票数 0

我正在尝试读取SharePoint文档库中Visio文件的SharePoint属性(如版本)。

在Word、Excel和PowerPoint中,您可以通过SharePoint (Word)、工作簿(Excel)或ActivePresentation (Powerpoint)的“.DocumentTypeProperties”属性来读取ActiveDocument属性。显示具有所有SharePoint属性的Messagebox的PowerPoint示例:

代码语言:javascript
运行
复制
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版本(标准版还是专业版)?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-06-25 23:21:38

没有从Visio文件读取(用户定义的) Visio文件SharePoint属性的API。

不过,您始终可以自己解析Visio文件。如果这些属性存在于文件中,您将能够获取它们,因为Visio文件现在只是一堆压缩的xml文件(假设文件不是旧的二进制格式)

票数 0
EN

Stack Overflow用户

发布于 2019-06-25 21:30:56

AFAIk没有DocumentTypeProperties,但是您可以直接从document对象访问标准的AFAIk。MSDN Discussion

代码语言:javascript
运行
复制
ThisDocument.FullName
ThisDocument.TimeCreated
ThisDocument.Creator

如果您想在文档中保存一些信息,可以将它们保存在Document ThisDocument.DocumentSheet的Shapsheet中,到目前为止,我还没有找到更好的选择。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56754893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档