SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a form library with a custom form associated. A user clicks "New form", inputs data in the form, and the form is saved to the library. Meanwhile, my logic in the eventreceivers generate a Word document and saves it to another library.

ItemAdded takes in a SPItemEventProperties properties object. It then uses properties.ListItem.File to get the data from the form.

This works the first time a document is created after the event receiver/solution is deployed. The SPFile has a length of 3k, and after I open it in binary it has an array of length 3k.

The second time and from then on, the SPFile object is not fully "saturated". The length-property of the file is 0, and the binary stream of the property yields an empty array. However, the File is not null, it has the correct name etc., just no content!

How could this be?

share|improve this question
up vote 1 down vote accepted

I solved the problem. The problem was that the ItemAdded didn't have full File information in the properties object (This is spesific for Doc. Libraries).

Since ItemUpdated always runs after ItemAdded, I just applied my logic there instead, because the File object is always correct in ItemUpdated apparently.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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