1Xwpfdocument doc =Newxwpfdocument ();2Xwpfparagraph P0 =Doc. Createparagraph ();3P0. Alignment =Paragraphalignment.left;4 5Xwpfrun R0 =P0. Createrun ();6R0. FontFamily ="Song Body";7R0. FontSize = -;8R0. IsBold =true;9R0. SetText ("password for student's account not logged in");Ten Onexwpftable table = doc. CreateTable (4,4); ATable. Width = the;//Set Table width -Table. Setcolumnwidth (0, -); - the -Xwpfparagraph PIO = table. GetRow (0). Getcell (0). paragraphs[0];//Gets the text box in row No. 0, column No. 0 -Xwpfrun RIO = Pio.createrun ();//Create edits -rio.fontfamily ="Microsoft Ya-Black"; +Rio.fontsize = A; -Rio.isbold =true; +Rio.settext ("0");//Copy A at - -FileStream OUT1 =NewFileStream ("Simpletable.docx", FileMode.Create);//output to default location - Doc. Write (OUT1); -Out1. Close ();
The above is a basic example of exporting a Word document through Npoi.
Export Word documents with Npoi