Package org.apache.poi.poifs.macros
Class VBAMacroExtractor
- java.lang.Object
-
- org.apache.poi.poifs.macros.VBAMacroExtractor
-
public class VBAMacroExtractor extends Object
This tool extracts out the source of all VBA Modules of an office file, both OOXML (eg XLSM) and OLE2/POIFS (eg DOC), to STDOUT or a directory.- Since:
- 3.15-beta2
-
-
Constructor Summary
Constructors Constructor Description VBAMacroExtractor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(File input, File outputDir)
Extracts the VBA modules from a macro-enabled office file and writes them to.vba
files inoutputDir
.void
extract(File input, File outputDir, String extension)
Extracts the VBA modules from a macro-enabled office file and writes them to files inoutputDir
.static void
main(String[] args)
-
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
extract
public void extract(File input, File outputDir, String extension) throws IOException
Extracts the VBA modules from a macro-enabled office file and writes them to files inoutputDir
. Creates theoutputDir
, directory, including any necessary but nonexistent parent directories, ifoutputDir
does not exist. IfoutputDir
is null, writes the contents to standard out instead.- Parameters:
input
- the macro-enabled office file.outputDir
- the directory to write the extracted VBA modules to.extension
- file extension of the extracted VBA modules- Throws:
IOException
- Since:
- 3.15-beta2
-
extract
public void extract(File input, File outputDir) throws IOException
Extracts the VBA modules from a macro-enabled office file and writes them to.vba
files inoutputDir
. Creates theoutputDir
, directory, including any necessary but nonexistent parent directories, ifoutputDir
does not exist. IfoutputDir
is null, writes the contents to standard out instead.- Parameters:
input
- the macro-enabled office file.outputDir
- the directory to write the extracted VBA modules to.- Throws:
IOException
- Since:
- 3.15-beta2
-
-