public void registerSaveEvent() { Document doc = this.ActiveUIDocument.Document; doc.DocumentSaving += new EventHandler(myDocumentSaving); } private void myDocumentSaving(object sender, DocumentSavingEventArgs args) { Document doc = sender as Document; string user = doc.Application.Username; string filename = doc.PathName; string filenameShort = Path.GetFileNameWithoutExtension(filename); string tempFolder = Path.GetTempPath(); string outputFile = Path.Combine(tempFolder,filenameShort + ".txt"); using (StreamWriter sw = new StreamWriter(outputFile,true)) { sw.WriteLine(DateTime.Now + ": " + user); } }