OK, the problem is bigger then I thought. When I use the ToDatabaseSummaryInfo method from Builder to update the drawing, all of the Custom Property keys are changed to lower case. This wreaks havoc across my drawing as any fields now show the #### as they are looking for the Cased Key Names.
Here's my complete function.
Code:
Public Function SetCustomProperty(ByVal Dwg As Autodesk.AutoCAD.ApplicationServices.Document, ByVal Name As String, ByVal Value As String) As Boolean
Dim Builder As AcadDb.DatabaseSummaryInfoBuilder
Builder = New AcadDb.DatabaseSummaryInfoBuilder(Dwg.Database.SummaryInfo)
Try
If Builder.CustomProperties.ContainsKey(Name) Then
Builder.CustomProperties.Item(Name) = Value
Else
Builder.CustomProperties.Add(Name, Value)
End If
Dwg.Database.SummaryInfo = Builder.ToDatabaseSummaryInfo
Catch
Return False
End Try
Return True
End Function
Suggestions please!