Create DOTM File via Java
Native and high performance Microsoft Word DOTM documents creation programmatically using Java library.
Generating MS Word DOTM file dynamically within running application is easy. In order to create DOTM documents from scratch having similar result as of New document in Microsoft Word without requiring MS Office, we’ll use
API that offers different features for document creation, manipulation and conversion using Java platform.
How to Create DOTM via Java
It is easy for the developers to creat, load, modify and convert DOTM files within running Word Automation applications for data processing in just few lines of code.
Before running the Java conversion sample source code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.Words for Java directly from Maven.
Following source code shows how to create a Word DOTM file using Java.
Document dotm = new Document(); DocumentBuilder builder = new DocumentBuilder(dotm); builder.write("hello world"); dotm.save("created_file.dotm");
DOTM What is DOTM File Format
A file with DOTM extension represents template file created with Microsoft Word 2007 or higher. It is similar to the popular DOCX file format other than it retains the user defined settings for reuse in case of creating new documents. Such documents are more often used in offices where a standard template file is generated with settings like page information, margins, default layout and macros, and is used to create new documents from it when required. DOTM files, however, save macros, that are a series of commands in the form of recorded actions for automatic completion of a task. This helps save time in carrying out actions that are repeated in completion of a task.Read More
Other Supported Document Generation
You can also create other Microsoft Word files including few listed below.