Top Description Constructors Methods
org.apache.poi.poifs.macros

public Class VBAMacroExtractor

extends Object
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, .OutputStream, .OutputStreamWriter, java.nio.file.Files, java.util.Map, .Map.Entry, org.apache.poi.util.StringUtil

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
extract(File
the macro-enabled office file.
input
,
File
the directory to write the extracted VBA modules to.
outputDir
,
String
file extension of the extracted VBA modules
extension
)

Extracts the VBA modules from a macro-enabled office file and writes them to files in outputDir.

public void
extract(File
the macro-enabled office file.
input
,
File
the directory to write the extracted VBA modules to.
outputDir
)

Extracts the VBA modules from a macro-enabled office file and writes them to .vba files in outputDir.

public static void
main(String[] args)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VBAMacroExtractorback to summary
public VBAMacroExtractor()

Method Detail

extractback to summary
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 in outputDir. Creates the outputDir, directory, including any necessary but nonexistent parent directories, if outputDir does not exist. If outputDir is null, writes the contents to standard out instead.

Parameters
input:File

the macro-enabled office file.

outputDir:File

the directory to write the extracted VBA modules to.

extension:String

file extension of the extracted VBA modules

Since
3.15-beta2
extractback to summary
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 in outputDir. Creates the outputDir, directory, including any necessary but nonexistent parent directories, if outputDir does not exist. If outputDir is null, writes the contents to standard out instead.

Parameters
input:File

the macro-enabled office file.

outputDir:File

the directory to write the extracted VBA modules to.

Since
3.15-beta2
mainback to summary
public static void main(String[] args) throws IOException