Manipulating PowerPoint Custom Document Properties Using ActiveX

7 ビュー (過去 30 日間)
John Feiereisen
John Feiereisen 2020 年 12 月 11 日
コメント済み: John Feiereisen 2020 年 12 月 14 日
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

回答 (1 件)

Sean de Wolski
Sean de Wolski 2020 年 12 月 11 日
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 件のコメント
John Feiereisen
John Feiereisen 2020 年 12 月 14 日
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).

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by