Programmatically Determine if Document was Uploaded RRS feed

  • Question

  • Hello.

    I have a document library with incoming email enabled on it.  I would like to programmatically distinguish between when a document is uploaded or emailed into the library so that I can prompt the user for manual entry of metadata if the document is uploaded. If a document is emailed into the library a workflow will run.

    Is there a way via the API to do this?

    Wednesday, June 9, 2010 10:34 AM


All replies

  • One solution might be to have a custom page/webpart to upload document. So the document will be uploaded by a custom web part using SharePoint Object model. in that web part u can set some hidden property of the document (say ImportType) to some value. An Event receiver will fire up and check if the ImportType is set to the value (say upload). If so your event receiver may work that's u need to do for upload. If the ImportType is not set then u can take for granted that the document is imported by email.


    Sohel Rana
    Wednesday, June 9, 2010 11:03 AM
  • You can add an emaileventhandler to it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spemaileventreceiver.aspx
    Thsi eventhandler can set a boolean field to true for example.



    My blog on WSS / MOSS development is found at http://jebass.blogspot.com
    Wednesday, June 9, 2010 11:19 AM