Microsoft Word as a Java "IDE"
Set the path to Java's \bin
(at the top in the macro).
Copy or modify the provided .docm
file. Alternatively, you can import the macro using any .docm
file.
Of course, make sure your Word document has the same name as your Java class!
To build and run, click Macros under the View tab. Make sure JavaWord is selected, then click Run.
To add a shortcut to the macro in the quick access toolbar (as shown in the example above), follow these steps:
-
Right click on one of the icons at the top left (e.g. save, undo, redo) and select Customize Quick Access Toolbar...
-
Under Chose commands from, select Macros
-
Select the macro (should be Project.NewMacros.JavaWord), and click Add >>
-
(optional) To change the icon to the usual "run" icon (triangle), click Modify..., select the icon, and click OK
-
Click OK to close
You can now run your code by simply clicking the newly added button!