Extension to listen to document open and save events


PurposeA component can listen to events fired by the application when a document is created, opened, or closed. However, no event is fired when a document is saved. To log the time when a document is saved, create a custom extension that implements persistence. This sample shows how to implement an application extension that logs user and date time information when a document is opened or saved.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open and compile the sample project in Visual Studio. Set up a debug application if needed.
  2. Start ArcMap, ArcScene, or ArcGlobe.
  3. Open or save a document.
  4. Check the status bar for a message with the user name and time information of the event.

LogExtension.cs Class implementing an extension that listens to document events.
Download the C# files
LogExtension.vb Class implementing an extension that listens to document events.
Download the VB.NET files

Download the files for all languages

See Also:

How to listen to document events




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced