当我在文档形状表上创建形状数据字段时,我如何才能为文档提取这些形状数据,就像我如何为页面和特定形状那样做?
我知道我可以使用 TheDoc!拉用户定义的单元格和形状数据,但我想看看我是否可以改用形状数据。
您必须打开文档形状表窗口(紧急)并按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