我正在尝试更新文档属性并创建新条目(如果它们不存在)
但是这种类型的东西不起作用
Set objDocProps = DSO.GetDocumentProperties(sfilename:=FileName)
With objDocProps
If .CustomProperties("ABC") Is Nothing Then
'create it here
如果我在那里放置一个错误处理程序,它会被锁定或失去连接
errhandler:
Select Case Err.Number
Case -2147220987 ' missing custom property
Debug.Print "missing custom property"
With objDocProps
.CustomProperties("ABC").Value = "banana!"