Need to implement the ability to export Word documents, online about POI generation of Word documents, few examples, looking for a long time to find a demo in the official website, with a demo everything will be good to do.
[Java] View Plain copy/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. see the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the apache license, version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the license at http://www.apache.org/licenses/license-2.0 Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" basis, without warranties or conditions of any kind, either express or implied. see the license for the specific language governing permissions and limitations under the license. =========================================================== ========= */ package org.apache.poi.xwpf.usermodel; import java.io.fileoutputstream; /**  * A SIMPLE WORDPROCESSINGML document created by poi xwpf api * * @author Yegor Kozlov */ public class simpledocument { public static void main (String[] args) throws Exception { xwpfdocument doc = new xwpfdocument (); XWPFParagraph p1 = Doc.createparagraph (); p1.setalignment ( Paragraphalignment.center); p1.setborderbottom ( borders.double); p1.setbordertop (Borders.DOUBLE); p1.setborderright (borders.double);     &NBsp; p1.setborderleft (borders.double); p1.setborderbetween (borders.single); p1.setverticalalignment (textalignment.top); xwpfrun r1 = p1.createrun (); r1.setbold (True); r1.settext ("The quick brown fox "); r1.setbold (True); r1.setfontfamily ("Courier"); r1.setunderline (underlinepatterns.dot_dot_dash); r1.settextposition (m); &nbSp; xwpfparagraph p2 = doc.createparagraph (); p2.setalignment (paragraphalignment.right); //BORDERS P2.setborderbottom (borders.double); p2.setbordertop (borders.double); p2.setborderright (Borders.DOUBLE) ; p2.setborderleft (Borders.DOUBLE); p2.setborderbetween (borders.single); xwpfrun r2 = p2.createrun ();