How to set the document's author and title

Home Forums SpreadsheetML How to set the document's author and title

This topic contains 3 replies, has 2 voices, and was last updated by  Jim Snyder 1 year, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #3928


    Hi all,

    So far, I have successfully written a Spreadsheet document using Open XML SDK 2.5 and C#. I’ve got styles and content done, but I am unable to set the document’s author and title.

    I know that those values are set at ./docProps/core.xml. I’ve got this far:

    `SpreadsheetDocument doc = SpreadsheetDocument.Create(

    CoreFilePropertiesPart cfpPart = doc.AddCoreFilePropertiesPart();
    // NOW WHAT?`

    I don’t know what to do with the cfpPart. Any help would be appreciated. Thanks,


    Jim Snyder

    I’ll admit I don’t know how to do it the way you are asking, but this is how I do it:
    ` private void SetPackageProperties(SpreadsheetDocument wkbk)
    wkbk.PackageProperties.Creator = “Jim Snyder”;
    wkbk.PackageProperties.Created = DateTime.Now;
    wkbk.PackageProperties.Modified = DateTime.Now;
    wkbk.PackageProperties.LastModifiedBy = “Jim Snyder”;

    wkbk.PackageProperties.Category = “Regional Report”;
    wkbk.PackageProperties.Description = “Inventory Recon rpt.”;
    wkbk.PackageProperties.Subject = “Regional recon”;
    wkbk.PackageProperties.Title = “O’Bleness/AdviCare Inventory Recon – Daily”;



    That worked perfectly. Thank you Jim.


    Jim Snyder

    I appreciate you saying thanks! Now I can go home on a Friday with a sense of accomplishment. ==;-)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.