I am trying to save the map document that is currently open. How do I write the code? I have tried many suggestions that I found using Google searches, but nothing works. Currently I have:
Dim clickedDoc As IMapDocument = My.ArcMap.Application.Document
clickedDoc.Save(True, False)
which causes ArcMap to crash. I did get it to work with some other code, but it wouldn't actually save.
Also, this should be a background job. So no save dialog should come up.