Manipulating PowerPoint Custom Document Properties Using ActiveX

6 visualizzazioni (ultimi 30 giorni)
My organization requires certain markings to be included in Office documents when saving, printing, etc., and I believe these markings are stored as custom document properties. There is a PowerPoint add-in that adds these for us via a GUI. However, I am using ActiveX to generate presentations, add figures, etc. and when saving the file the GUI pops up and stops everything, waiting for user input. I'd like to add all the required markings programmatically to avoid the GUI popping up. First I need to see what all the markings are, then I need to figure out how to set them in virgin presentations so they're completely compliant with policy.
I have Powerpoint files I created in PowerPoint that are identical, except one is marked and the other is not. The unmarked one has 1 custom document property. The marked one has 11 custom document properties. I can see the number of properties, but I can't figure out how to see what those properties are named, what their values are, or how to add new properties. How do I do this?
Thanks.
No markings:
>> pres = ppt.Presentations.invoke('Open',fullfile(pwd,'nomarking.pptx'));
>> CustDocProps = pres.CustomDocumentProperties;
>> get(CustDocProps)
Parent: [1×1 Interface.9149349D_5A91_11CF_8700_00AA0060263B]
Count: 1
Application: 'Invoke Error, Dispatch Exception: Unspecified error←↵'
Creator: 1.3479e+09
Yes markings:
>> pres = ppt.Presentations.invoke('Open',fullfile(pwd,'yesmarking.pptx'));
>> CustDocProps = pres.CustomDocumentProperties;
>> get(CustDocProps)
Parent: [1×1 Interface.9149349D_5A91_11CF_8700_00AA0060263B]
Count: 11
Application: 'Invoke Error, Dispatch Exception: Unspecified error←↵'
Creator: 1.3479e+09

Risposte (1)

Sean de Wolski
Sean de Wolski il 11 Dic 2020
You should strongly consider using the MATLAB Report Generator to generate the presentations. It lets you use existing templates and dynamically add content as necessary.
  1 Commento
John Feiereisen
John Feiereisen il 14 Dic 2020
I already have a library of codes for manipulating PowerPoint presentations that we have been using for years. All it's missing is adding these CustomDocumentProperties (a relatively new requirement in my organization).

Accedi per commentare.

Categorie

Scopri di più su MATLAB Report Generator in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by