I am working with C# and ArcObjects. I am having trouble determining if an .mxd file is loaded or currently open. I have been looking at the IMapDocument and IMxDocument objects, as well as the IMapDocument.IsMapDocument property but I am not following. I am not able to mimic its functionality.
All I am trying to accomplish is a function that returns a boolean value or even a message saying 'Yes' if there is a map document loaded/opened and 'No' if a map document is not loaded/opened.
Any help on this topic would be greatly appreciated. Thanks in advance.
You should be able to check if the IApplication.Document property is null. If it is not null, a file is open. I haven't checked if this works, but this would be my approach.
I see. Thanks for your input. I'll take a look and experiment with this and see what I can come up with. Should be able to create and test a simple boolean function to see if it suits my needs.