- Advanced with use of Word Template : Easy installation and improved performance
- Standard with manual installation
Word Template
Adriaan van den Brand has made several improvements to the VBA script. He has created a Word Template that allows a better integration between Word and PlantUML and better performance.This template allows using PlantUML directly from MS Word 2010 without need to alter document templates or edit VBA macro's. MS Word Versions 2007 and 2013 might work, but are not tested.
Everything is documented in the template itself, that you can download here (PlantUML Template v23.dotm).
Many thanks for his works!
Manual installation
If you wish, you can use the manual installation.
The integration between PlantUML and Word (Word 2003 and Word 2007) is done using
the following new buttons bar:

- When the user click on the "Show/Hide PlantUML" buttons, the source text of the diagrams are shown or hidden.
- When the user click on the "UML.*" buttons :
- The Word document is scanned entirely, looking for
@startumland@endumltext. - If an image was already generated for this diagram, this image is removed.
- An new image is generated and automatically added after the
@enduml. - The style of the text between
@startand@endis changed toPlantUML, so that is hidden
- The Word document is scanned entirely, looking for
- The button "UML.1" does the same thing, but only for one diagram (the current one), which is faster, especially with large document.
Macro Security
Unfortunately, since PlantUML is written in Java, the Word macro must launch a new process when it runs, and this is a big security risk.So you have to lower the security of Word to be able to use PlantUML .
Short Installation Guide
- Put a copy of plantuml.jar in the same directory of your Word document.
- Put a copy of PlantUML_V007.bas in the same directory of your Word document.
- In the menu
Tools/Macro/Security, set the security toLow. (So that the macro can launch the Java process). - Open the Visual Basic Editor with the menu
Tools/Macro/Visual Basic Editor. - With the mouse right button, choose
Import a fileon your document and choose thePlantUML_V007.basfile. - The macro is now imported, so close the Visual Basic Editor
- The very first time, launch the macro
Macro_UML_allwith the menuTools/Macro/Macros.... - This will create the new toolbar
- Test it!
The macro searches the plantuml.jar file in that order:
- In the same directory as your document
- Then, in the parent directory of this directory
- Then, in the parent directory of the parent... up to the root folder
- Then, in the same directory as the
normal.dotfile - Then, in the parent directory of this directory
- Then, in the parent directory of the parent... up to the root folder
plantuml.jar file is not found, a box display the list of all searched directories.
Demonstration
- You can write this document :

- Then you click on "UML.*" :
- When the macro has finished, you will have :

- If you click on "Hide PlantUML" :















