I have a Java application that is required to do a bunch of stuff to a PowerPoint file, one of which involves invoking an existing PowerPoint macro and passing parameters to it. Here are some sample code:
public static void main (String[] args) {
createPptFile("test");
/* Do stuff */
/* Call macro here */
/* Do more stuff */
}
Sub SaySomething(something)
MsgBox(something)
End Sub
The Java application first creates a new test.pptm
file, then at some point later the application is supposed to call SaySomething(something)
while passing a value to it. How can I do this? What libraries, if any, would I need? Please provide some sample code to show how this can be done.
The application is to be implemented using Java 1.8, and will run on Windows 10 and using Microsoft Office 2013. Apache POI is being used to edit PowerPoint files at present, though using it is not mandatory.