1

这是我当前的代码。

Sub PrintMasterTime()

Dim PropVal As Integer
    PropVal = ActiveDocument.CustomDocumentProperties(MasterTime).Value
    Print PropVal

End Sub

编译错误:Method not valid without suitable object

不知道为什么它不打印。"MasterTime"是我的自定义文档属性的名称。

4

1 回答 1

1

您需要CustomDocumentProperties使用字符串调用。你忘记了引号。

PropVal = ActiveDocument.CustomDocumentProperties("MasterTime").Value
于 2015-01-07T15:44:21.277 回答