Hi all:
Newbie with a question here. I've been able to finally locate enough info to figure out how to read & change the summary info in dwg files from in Access w VBA & ObjectDBX, but when I clean up, either I can't get it to start up, or the acad.exe process is still hanging around.
Would someone pls clue me in on how to finish it off without needing user intervention?
If I do it like this,
Dim objAcad As Object
Dim dbxDoc As AxDbDocument
Dim oSumInfo As AcadSummaryInfo
Dim strDwgName As String
strDwgName = "D:\Working\Doc_nums_and_logs\NewVersionOffice\Drawing1.dwg"
Set objAcad = GetObject(, "AutoCAD.Application.16")
Set dbxDoc = objAcad.GetInterfaceObject("ObjectDBX.AxDbDocument.16")
dbxDoc.Open (strDwgName)
Set oSumInfo = dbxDoc.SummaryInfo
MsgBox "this is it before " & oSumInfo.Comments
dbxDoc.SummaryInfo.Comments = "changed here by me again"
dbxDoc.SaveAs (strDwgName)
objAcad.Quit
MsgBox "this is it after " & oSumInfo.Comments
objAcad.Quit
Set oSumInfo = Nothing
Set dbxDoc = Nothing
Set objAcad = Nothing
Then it won't work without Autocad already being started.
If I do it like this, without the 'object' :
Dim dbxDoc As AxDbDocument
Dim oSumInfo As AcadSummaryInfo
Dim strDwgName As String
strDwgName = "D:\Working\Doc_nums_and_logs\NewVersionOffice\Drawing1.dwg"
Set dbxDoc = GetInterfaceObject("ObjectDBX.AxDbDocument.16")
dbxDoc.Open (strDwgName)
Set oSumInfo = dbxDoc.SummaryInfo
MsgBox "this is it before " & oSumInfo.Comments
dbxDoc.SummaryInfo.Comments = "changed here by me again"
dbxDoc.SaveAs (strDwgName)
MsgBox "this is it after " & oSumInfo.Comments
Set oSumInfo = Nothing
Set dbxDoc = Nothing
Then it will start up OK without Autocad already being started, but it won't close correctly and keeps the acad.exe process active. (as far as I can tell) But if I don't have an object to close, what do I do ?
Thanks for any clues, but the really blatant ones are appreciated even more