I have created an event reciever for SharePoint Server 2010 with added and updated events.

The work is being done whenever a doc file is added to my library, it generates a copy of that file in pdf format. For this I am using Microsoft.office.interlop dll.

When any properties of an doc file is edited the same is being reflected to pdf copy.

Till now everythings fine.

But when I edit the content of the document file already uploaded in document library, the control does not call ItemUpdated event. I want the changes made in doc file to be reflectd in pdf file.

How could I achieve this?

  • How are you attaching your event receivers to the doc library? Declaratively as part of a feature, or through code?
    – Paul Lucas
    Dec 15, 2011 at 19:18
  • while creating the project i just attached document library and checked the name of library in code.
    – Mohit
    Dec 16, 2011 at 9:46

1 Answer 1


My best guess is that your event handler is firing, but is failing in its attempt to copy the file content to pdf.

The reason is because when you have a document open in MS word for example, word will take out a lock on that file to prevent anyone/anything editing the contents at the same time. When you save the file, the updated event will fire, but because the lock is still there your code may not be able to access the new content.

Hope that makes sense.

  • I tried running the code in debug mode and found that ItemUpdated event is not firing.
    – Mohit
    Dec 16, 2011 at 9:45
  • Can you try with a jpg or a png file, and see if the event receiver doesn't fire? I have had this weird experience where event receivers didn't fire for PDF files. Jan 15, 2012 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.