Summary: | VBAMacroReader misses macro in one test ppt | ||
---|---|---|---|
Product: | POI | Reporter: | Tim Allison <tallison> |
Component: | POI Overall | Assignee: | POI Developers List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows NT | ||
Attachments: | file from TIKA-2069 |
"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 :) |
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.