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,
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.
I appreciate you saying thanks! Now I can go home on a Friday with a sense of accomplishment. ==;-)
You must be logged in to reply to this topic.