Visio 形状数据 - 文档级别

问题描述 投票:0回答:1

当我在文档形状表上创建形状数据字段时,我如何才能为文档提取这些形状数据,就像我如何为页面和特定形状那样做?

Document ShapeSheet window

我知道我可以使用 TheDoc!拉用户定义的单元格和形状数据,但我想看看我是否可以改用形状数据。

ThePage Shape data window

visio shapesheet
1个回答
0
投票

如何通过用户界面做到这一点

您必须打开文档形状表窗口(紧急)并按Shape Data按钮 How documents shape data

如何通过代码做到这一点

运行这个程序

Sub CallCustomData()
On Error Resume Next ' without this line there will be an error if the date is not changed
Dim aw As Window ' the variable associated with the active window
Set aw = ActiveWindow ' the assignment to the variable associated with the active document window
Dim cl As Cell, wn As Window ' 
Set wn = ActiveDocument.DocumentSheet.OpenSheetWindow ' Open the document properties window
wn.WindowState = visWSMinimized ' minimize the document properties window
wn.Activate ' make the document properties window active
Set cl = ActiveDocument.DocumentSheet.Cells("Prop.row_1") ' the cell with the stored date
cl.Application.DoCmd (1312) ' call the Shape Data window
aw.Activate ' bring focus back to the active document window
wn.Close ' closing the document properties window
aw.WindowState = visWSMaximized ' restoring the size of the active document window
End Sub
© www.soinside.com 2019 - 2024. All rights reserved.