Created attachment 34289 [details] file from TIKA-2069 While working on TIKA-2069, I found that I wasn't able to extract macros from a test ppt file that I generated. May be user error in generating the test file. However, POI successfully extracted macros from the original 'pptm' file that I saved as ppt.
"Sub Embolden()" and "Sub Italicize" should show up in the text of the macros.
The macros are stored in a POIFS within an ExOleObjStg within the "PowerPoint Document". Brilliant!!! If you add this to the end of buildRecords() in HSLFSlideShowImpl: for (Record r : _records) { if (r.getRecordType() == 4113) { ExOleObjStg exOleObjStg = (ExOleObjStg) r; try { NPOIFSFileSystem npoifs = new POIFSFileSystem(exOleObjStg.getData()); VBAMacroReader reader = new VBAMacroReader(npoifs); System.out.println(reader.readMacros()); } catch (IOException e) { e.printStackTrace(); } } } The macros are correctly read. Recommendations for the least smelly way to extract these? Unlike the other document formats, this requires a full parse of the document, we can't just pass in the parent POIFs. Add a getMacros() to HSLFSlideShowImpl for now?
As always, Yegor had already figured this out: https://bz.apache.org/bugzilla/show_bug.cgi?id=43376 :)
Y, so it wasn't just Yegor, but just about the entire POI team already knew this... Thanks to Javen for pointing 59302 out to me. Sorry for the duplicate! *** This bug has been marked as a duplicate of bug 59302 ***