ドキュメントのプロパティを更新し、存在しない場合は新しいエントリを作成しようとしています
ただし、このタイプのことは機能しません
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!"