private void WriteHeader(StreamWriter sw) { OutLineBuilder line = new OutLineBuilder(); line.AddColumn("Path"); line.AddColumn("Size"); line.AddColumn("LastWriteTime"); line.AddColumn("Title"); line.AddColumn("Subject"); line.AddColumn("Category"); line.AddColumn("Keywords"); line.AddColumn("Comments"); line.AddColumn("Author"); line.AddColumn("LastSavedBy"); line.AddColumn("RevisionNumber"); line.AddColumn("Company"); line.AddColumn("Version"); line.AddColumn("DigitalSignature"); line.AddColumn("Manager"); line.AddColumn("Template"); sw.WriteLine(line.ToString()); }
private void WriteFileInfo(StreamWriter sw, FileInfo fileInfo) { OutLineBuilder line = new OutLineBuilder(); line.AddColumn(fileInfo.FullName); line.AddColumn(fileInfo.Length); line.AddColumn(fileInfo.LastWriteTime); OleDocumentProperties props = null; try { props = new OleDocumentProperties(); props.Open(fileInfo.FullName, true, dsoFileOpenOptions.dsoOptionDefault); SummaryProperties summaryProps = props.SummaryProperties; line.AddColumn(summaryProps.Title); line.AddColumn(summaryProps.Subject); line.AddColumn(summaryProps.Category); line.AddColumn(summaryProps.Keywords); line.AddColumn(summaryProps.Comments); line.AddColumn(summaryProps.Author); line.AddColumn(summaryProps.LastSavedBy); line.AddColumn(summaryProps.RevisionNumber); line.AddColumn(summaryProps.Company); line.AddColumn(summaryProps.Version); line.AddColumn(summaryProps.Manager); line.AddColumn(summaryProps.Template); } catch (Exception e) { line.AddColumn(e.Message); } finally { if (props != null) { props.Close(false); } } sw.WriteLine(line.ToString()); }