读取系统文档属性

Sub read()
On Error Resume Next
rw = 1
Worksheets(1).Activate
For Each p In ActiveWorkbook.BuiltinDocumentProperties
    Cells(rw, 1).Value = p.Name
    Cells(rw, 2) = p.Value
    rw = rw + 1
Next
End Sub

读取自定义文档属性

Sub Macro1()

 Cells(1, 2) = ActiveWorkbook.CustomDocumentProperties("完成日期").Value

End Sub

增加自定义属性

Sub add()
    ActiveWorkbook.CustomDocumentProperties.add Name:="完成日期", Type:=msoPropertyTypeDate, LinkToContent:=False, Value:="31/12/2009"
End Sub

修改

Sub modf()
     ActiveWorkbook.BuiltinDocumentProperties("Last Save Time").Value = "31/12/2009"
End Sub

删除

Sub del()
    ActiveWorkbook.CustomDocumentProperties("完成日期").delete
End Sub

相关文章:

  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-05
  • 2021-10-26
  • 2021-10-15
  • 2022-12-23
  • 2021-08-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2021-10-30
  • 2021-10-03
相关资源
相似解决方案