Manipulating PowerPoint Custom Document Properties Using ActiveX
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!