Example #1
0
        public static XlCustomProperties LoadProperties(string fileName)
        {
            XlCustomProperties Props = new XlCustomProperties();

            using (var dSpreadsheet = SpreadsheetDocument.Open(fileName, false))
            {
                if (dSpreadsheet.CustomFilePropertiesPart != null)
                {
                    foreach (var m in dSpreadsheet.CustomFilePropertiesPart.Properties.Elements <CustomDocumentProperty>())
                    {
                        String name = m.Name.Value;
                        if (m.VTLPWSTR != null)
                        {
                            Props.AddCustomProperty(name, m.VTLPWSTR.Text);
                        }
                    }
                }
            }
            return(Props);
        }
Example #2
0
 public XlWorkbook()
 {
     Worksheets = new XlWorksheets();
     Properties = new XlCustomProperties();
 }