COMException (0x81020037): The file blah.docx has been modified by domain\user.

Posted Tuesday, February 5, 2008 8:37 AM by CoreyRoth

I was working on an ItemEventReceiver the other day and ran into this lovely unmanaged exception.  Luckily, the fix is easy, because I knew exactly what I had done wrong.  I noticed there wasnt a ton out there on Google about it, so I figured I would post to help out others that might see it.  The error occurred when I was uploading a document based upon a custom content type.  After getting prompted to fill in metadata, the following error occurred.

COMException (0x81020037): The file blah.docx has been modified by domain\user.

I immediately knew what I had done wrong.  I forgot to turn off EventFiring before calling SystemUpdate().  This was in turn causing an Update event to fire which obviously wouldnt work because another Update event was alrady in progress.  If you don't remember how to turn off EventFiring, here is what the code looks like.

DisableEventFiring();
item.SystemUpdate(false);
EnableEventFiring();
Filed under: ,

Comments

# re: COMException (0x81020037): The file blah.docx has been modified by domain\user.

Friday, March 6, 2015 10:42 AM by Jude

This is very good insight !

Thanks

Leave a Comment

(required)
(required)
(optional)
(required)