none
How to fetch BuiltinDocumentProperties of PPT when the pptx file is closed using excel VBA RRS feed

  • Question

  • Hi,

    I want to fetch the subjects and authors of a pptx file without opening the  file. I shall provide the path as an input and Subjects & Authors of all the PPTs will be populated one by one from B1 & C1 cell respectively without opening any of the PPT files.

    I can do it by opening the PPT file but don't know the procedure of fetching document properties by keeping the file close. Any help would be highly appreciated.

    Dim PPT As PowerPoint.Application
    Set PPT = New PowerPoint.Application
    With PPT
    .Presentations.Open Filename:="C:\Users\JO\Desktop\Test.pptx"
    
    Worksheets("Sheet1").Cells(1, 2).Value = .ActivePresentation.BuiltinDocumentProperties.Item("Comments")
    
    End With

    Thanks in advance!!

    Monday, February 1, 2016 7:07 PM

Answers

  • Hi JO_LO,

    What do you mean without opening any of the PPT files? Do you mean don’t open it through office process?

    If so, we can’t do it through VBA macro or call VBA macro from .net application, because it will use the office process.

    More information, please refer to:

    # How to run Office macros by using Automation from Visual Basic .NET

    https://support.microsoft.com/en-us/kb/306682

    For this requirement, I suggest that you could do it through Open XML. There is CoreFilePropertiesPart property of PresentationDocument object and it has the OpenXMLPackage property, then you could get PackageProperties property and get the Description (comment) or other properties.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 2, 2016 7:51 AM
    Moderator

All replies

  • Hi JO_LO,

    What do you mean without opening any of the PPT files? Do you mean don’t open it through office process?

    If so, we can’t do it through VBA macro or call VBA macro from .net application, because it will use the office process.

    More information, please refer to:

    # How to run Office macros by using Automation from Visual Basic .NET

    https://support.microsoft.com/en-us/kb/306682

    For this requirement, I suggest that you could do it through Open XML. There is CoreFilePropertiesPart property of PresentationDocument object and it has the OpenXMLPackage property, then you could get PackageProperties property and get the Description (comment) or other properties.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 2, 2016 7:51 AM
    Moderator
  • Re: reading file properties from closed files

    Another way...
    Download the Dsofile.dll  ... https://support.microsoft.com/en-us/kb/224351
    Review this...   http://www.cpearson.com/Excel/DocProp.aspx
    '---

    Jim Cone
    Portland, Oregon USA
    https://goo.gl/IUQUN2 (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Edited by James Cone Monday, October 31, 2016 12:59 PM
    Tuesday, February 2, 2016 7:46 PM