Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Fetching meta data of MS Office files [modified]

Fetching meta data of MS Office files [modified]

Scheduled Pinned Locked Moved C#
tutorialhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sachinkalse
    wrote on last edited by
    #1

    We are trying to fetch Author, Company Name and Creation Date of MS Office Files (.doc, .docx, .xls, .xlsx, .ppt, .pptx) using following code protected void Page_Load(object sender, EventArgs e) { string strFileName = string.Empty; strFileName = @"D:\My File.pptx"; DSOFile.SummaryProperties DSOSummaryProperties; DSOFile.OleDocumentPropertiesClass OleFile; OleFile = new OleDocumentPropertiesClass(); OleFile.Open(strFileName, true, dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess); DSOSummaryProperties = OleFile.SummaryProperties; Response.Write("Author : " + DSOSummaryProperties.Author); Response.Write(" Company : " + DSOSummaryProperties.Company); Response.Write(" Date Created : " + DSOSummaryProperties.DateCreated); OleFile.Close(false); } This works well in many conditions except stated below 1. If we try to rename .docx as .doc or .xlsx as .xls or .pptx as .ppt In this situation no data is fetched, but no error too 2. When file is created like, Right Click in any drive -> New -> New Microsoft Office Word Document.docx or New Microsoft Office Excel Worksheet.xlsx or New Microsoft Office PowerPoint Presentation.pptx In this case while opening the file following error is generated Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) Please guide, if any one knows the reason behind. More over how to fetch meta data of .xps files?

    modified on Thursday, April 17, 2008 4:06 AM

    U 1 Reply Last reply
    0
    • S sachinkalse

      We are trying to fetch Author, Company Name and Creation Date of MS Office Files (.doc, .docx, .xls, .xlsx, .ppt, .pptx) using following code protected void Page_Load(object sender, EventArgs e) { string strFileName = string.Empty; strFileName = @"D:\My File.pptx"; DSOFile.SummaryProperties DSOSummaryProperties; DSOFile.OleDocumentPropertiesClass OleFile; OleFile = new OleDocumentPropertiesClass(); OleFile.Open(strFileName, true, dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess); DSOSummaryProperties = OleFile.SummaryProperties; Response.Write("Author : " + DSOSummaryProperties.Author); Response.Write(" Company : " + DSOSummaryProperties.Company); Response.Write(" Date Created : " + DSOSummaryProperties.DateCreated); OleFile.Close(false); } This works well in many conditions except stated below 1. If we try to rename .docx as .doc or .xlsx as .xls or .pptx as .ppt In this situation no data is fetched, but no error too 2. When file is created like, Right Click in any drive -> New -> New Microsoft Office Word Document.docx or New Microsoft Office Excel Worksheet.xlsx or New Microsoft Office PowerPoint Presentation.pptx In this case while opening the file following error is generated Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) Please guide, if any one knows the reason behind. More over how to fetch meta data of .xps files?

      modified on Thursday, April 17, 2008 4:06 AM

      U Offline
      U Offline
      User 7657639
      wrote on last edited by
      #2

      Same issue with my code!! (Exception from HRESULT: 0x80004005 (E_FAIL)) Did you find any solution for this??? Please reply

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups