i need to close and discard a document.
i use the right command but after this, i need to open the same document when the user say YES to do this
but my code in acad 2010 for fine not in acad2014.
Try
DocumentExtension.CloseAndDiscard(Doc)
Catch ComEX as COMException
End Try
.....
If msgbox(.....) = vbYes then
DocumentCollection.open(....)
.....
with this i have when i quit my prog. 2 docs open with the same name Test.dwg:1 and Test.dwg:2
Test.dwg is not closed when i send the Open command.
Another question : i need to catch the COMException. if i dont, acad show me a msgbox with continue button and stop button saying, the ComException is not handle in the code....
So how is the best use of this command.
PS : i use the commandfrag session (my code works fine in acad2010 when i use the framework3.5 and good dll.
Here is the open
Public Sub OpenDrawing()
Dim strFileName As String = "C:\campus.dwg"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
acDocMgr.Open(strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " & strFileName & _
" does not exist.")
End If
thanks but now i have all on 64b.
i use VS2013 and Acad 2015. no worry now with the code.
Acad 2014 and VS2010 is not very good choose.