Displaying document created date in Document Library

Hi,

I am wondering if there is a way to display the actual documents created date, not the date the document was saved to the library - I that is currently stored and available to display as 'Created Date'.

I have a client that when she emails attachments into SharePoint Document Libraries there is a column that can save the actual create date when the attachment was originally created.

Example:

Word document created on the 12/04/2013 and emailed into SharePoint Document Library on the 02/08/2013. We need to be able to see the 12/04/2013 date. Without typing this manually is there a way this can be done?

Thanks.

August 12th, 2013 4:51am

I think you can achieve this with an Item Added/Adding event receiver as we all know the document itself contains all the information about itself like (Created Date, Owner, Last Modified, etc).

You might have to parse the Word documents and fetch in the properties while uploading the document in the SharePoint Library through the event receiver and then save this value in some custom field of your library say "Document Created Date".

 
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2013 8:25am

Hi,

Here is a sample code on how to get the creation time of a source file:

                class DemoEventHandler : SPItemEventReceiver

    {

        HttpContext current;

        public DemoEventHandler()

        {

            current = HttpContext.Current;

        }

 

 

        public override void ItemAdding(SPItemEventProperties properties)

        {

            using (SPWeb site = properties.OpenWeb())

            {

                if (!site.Properties.ContainsKey("UploadFilePath"))

                {

                    site.Properties.Add("UploadFilePath", "");

                }

                HttpRequest request = current.Request;

                site.Properties["UploadFilePath"] = request.Files[0].FileName;

                site.Properties.Update();

            }

 

        }

        public override void ItemUpdating(SPItemEventProperties properties)

        {

            using (SPWeb site = properties.OpenWeb())

            {

                if (site.Properties["UploadFilePath"] != null)

                {

                    FileInfo fileInfo = new FileInfo(site.Properties ["UploadFilePath"].ToString ());

                    string actualCreationTime = fileInfo.CreationTime.ToString();

                    string actualModifyTime = fileInfo.LastAccessTime.ToString();

                }

            }

 

        }

 }

Check out the following link to get the detailed information:

Need to get actual created and modified time of the document while uploading file

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/465c2a18-e63b-43b1-bed2-b1bf1934f0d1/need-to-get-actual-created-and-modified-time-of-the-document-while-uploading-file

Thanks.

August 13th, 2013 2:33am

Is there a way to do this without code with just the 'out of the box' SharePoint funcitonality? Maybe some kind of a calculated column with a formula. Come on Mic
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 5:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics