I was working on some code for my xref manager, and thought about adding this functionality to it, but I can't seem to get it to work if a drawing that is selected is open in the editor, but not current. If it is current it will work just fine. The error I'm getting is an ' eLockViolation ', and I can't seem to find a way to get rid of it.
The code is locking the document it is called in.
The code is being executed after the dialog has been closed.
Acad '06, .Net 2.0.