/// <summary> /// Class constructor /// </summary> /// <param name="document">Document to perform operations on</param> /// <param name="fullName">Full path name of document</param> public PTWordprocessingDocument(OpenXmlSDK.WordprocessingDocument document, string fullName) : base() { Document = document; FullName = fullName; InnerContent = new WordprocessingDocumentManager(this); Comments = new CommentAccessor(this); Changes = new ChangeAccessor(this); Headers = new HeaderAccessor(this); Footer = new FooterAccessor(this); Setting = new SettingAccessor(this); CustomXml = new CustomXmlAccessor(this); Background = new BackgroundAccessor(this); Style = new StyleAccessor(this); Format = new ContentFormatAccessor(this); Picture = new PictureAccessor(this); Watermark = new WatermarkAccesor(this); Theme = new ThemeAccessor(this); TOC = new TOCAccessor(this); TOF = new TOFAccessor(this); TOA = new TOAAccessor(this); Index = new IndexAccessor(this); CoreProperties = new CorePropertiesAccesor(this); CustomProperties = new CustomPropertiesAccesor(this); }
/// <summary> /// Class constructor /// </summary> /// <param name="document">Document to perform operations on</param> /// <param name="fullName">Full path name of document</param> public SpreadsheetDocument(OpenXmlSDK.SpreadsheetDocument document, string fullName) : base() { Document = document; FullName = fullName; InnerContent = new SpreadsheetDocumentManager(this); Worksheets = new WorksheetAccessor(this); Chartsheets = new ChartsheetAccessor(this); CustomProperties = new CustomPropertiesAccesor(this); Tables = new SpreadSheetTableAccesor(this); Style = new SpreadSheetStyleAccessor(this); }
/// <summary> /// Creates a new SpreadsheetDocument from a new or existing file /// </summary> /// <param name="filePath">Path of file</param> /// <param name="createNew">Whether create a new document or load from an existing one</param> public SpreadsheetDocument(string filePath, bool createNew) { try { if (createNew) { Document = OpenXmlSDK.SpreadsheetDocument.Create(filePath, DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook); } else { Document = OpenXmlSDK.SpreadsheetDocument.Open(filePath, true); } } catch (Exception e) { System.Diagnostics.Debug.Write(e.Message); } FullName = filePath; InnerContent = new SpreadsheetDocumentManager(this); Worksheets = new WorksheetAccessor(this); Chartsheets = new ChartsheetAccessor(this); CustomProperties = new CustomPropertiesAccesor(this); }