Bug 59302 - Add support for reading VBA projects in HSLF
Summary: Add support for reading VBA projects in HSLF
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: unspecified
Hardware: Other All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
: 60162 (view as bug list)
Depends on:
Reported: 2016-04-11 16:47 UTC by Javen O'Neal
Modified: 2016-10-19 18:49 UTC (History)
1 user (show)

just a quick hack ... (14.49 KB, patch)
2016-04-12 00:09 UTC, Andreas Beeker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javen O'Neal 2016-04-11 16:47:33 UTC
HSLF doesn't have VBAInfo or VBAInfoAtom classes, or classes to look inside the external ole compressed container.
Comment 1 Nick Burch 2016-04-11 16:52:37 UTC
See http://poi.apache.org/poifs/embeded.html#Files+embedded+in+PowerPoint - PPT files are "special" (different team at Microsoft wrote it?), and embedded resources go in special records rather than at the OLE2 level...

I suspect you'll need to do something similar to Tika's HSLFExtractor's handleSlideEmbeddedResources method
Comment 2 Javen O'Neal 2016-04-11 17:18:40 UTC
Thanks for the info. I'll try to figure this out. LibreOffice 5 can't find the VBA Project in test-data/slideshow/SimpleMacro.ppt, which I created with PowerPoint 2007.
Comment 3 Javen O'Neal 2016-04-11 21:47:01 UTC
Format information is available in:
[MS-PPT]: PowerPoint (.ppt) Binary File Format Open Specifications Documentation [1]

[1] https://msdn.microsoft.com/en-us/library/office/cc313106%28v=office.12%29.aspx
Comment 4 Andreas Beeker 2016-04-12 00:09:35 UTC
Created attachment 33754 [details]
just a quick hack ...

This is just a quick hack ... to get you started.
Comment 5 Tim Allison 2016-10-19 11:59:29 UTC
*** Bug 60162 has been marked as a duplicate of this bug. ***
Comment 6 Tim Allison 2016-10-19 18:49:27 UTC

I made a few small changes (thanks to TestReWrite for finding one small bug!), but I basically left Andi's patch as is.

This will offer at least basic access to VBAMacros. 

I've tried to add info in the javadocs about how ppt is not supported by VBAMacroReader directly.

We can work on integrating macro extraction across the file types in another issue.  For now, advanced users have what they need.