Sample HTML file <APPLET CODE="test" WIDTH=600 HEIGHT=60 NAME="test"></APPLET> <APPLET CODE="lotus.wp.WordProcessor" WIDTH=600 HEIGHT=400 NAME="WP"></APPLET> Sample java file- get handle to word processor import lotus.wp.ifx.*; import lotus.wp.*; import java.awt.*; import java.applet.*; public class test extends Applet { public void init() { WordProcessor wp = null; while (wp == null) //Get handle to wordprocessor wp = (WordProcessor)getAppletContext().getApplet("WP"); try { Thread.sleep(5000); //wait for wordprocessor to load } catch (Exception e) {} //Add code here for individual methods } }
setTableWidth, setBorderWidth, getTableWidth, getBorderWidth int numRows = 4; int numCols = 3; String tableName = "MyTable"; int widthVal = 500; int borderWidth = 5; int returnwidthVal; int returnborderWidth; IWP_Table iwp_t = null; iwp_t = wp.insertTable(tableName,numRows,numCols); //create table set width and border iwp_t.setTableWidth(widthVal); iwp_t.setBorderWidth(borderWidth); returnwidthVal = iwp_t.getTableWidth(); //get table width and border values returnborderWidth = iwp_t.getBorderWidth(); System.out.println("The table width is "+returnwidthVal); //print out results System.out.println("The border width is "+returnborderWidth); enumerateTableCells, findTableCell, findTableCellByPosition IWP_Table iwp_t = null; IWP_Enumerator cells; IWP_TableCell cell; int numRows = 4; int numCols = 3; String tableName = "MyTable"; String indCell = ""; iwp_t = wp.insertTable(tableName,numRows,numCols); //create table cells = iwp_t.enumerateTableCells(); while( cells.hasMoreNames()) //print names of table cells { indCell = cells.nextName(); System.out.println("cells= "+indCell); } cell = iwp_t.findTableCell(indCell); //get handle to individual cells cell = iwp_t.findTableCellByPosition(2,2);//counting starts with zero setCellSpacing, getCellSpacing, getCellPadding IWP_Table iwp_t = null; int numRows = 4; int numCols = 3; String tableName = "MyTable"; int CellSpacing = 5; int CellPadding = 5; int getCellSpacing; int getCellPadding; iwp_t = wp.insertTable(tableName,numRows,numCols); //create table and set cell spacing and padding iwp_t.setCellSpacing(CellSpacing); iwp_t.setCellPadding(CellPadding); getCellSpacing = iwp_t.getCellSpacing(); getCellPadding = iwp_t.getCellPadding(); setAlignment, getAlignment, setVAlign, getVAlign iwp_t = wp.insertTable(tableName,numRows,numCols); //create table and table alignment iwp_t.setTableWidth(widthVal); iwp_t.setAlignment("right"); iwp_t.setAlignment("left"); iwp_t.setAlignment("center"); getAlignment = iwp_t.getAlignment(); wp.splitParagraph(); //set up some text to demonstrate VAlign wp.splitParagraph(); wp.right(false); wp.insertText("Table Text"); iwp_tc = iwp_t.findTableCellByPosition(0,1); //vertically align table text iwp_tc.setVAlign("bottom"); iwp_tc.setVAlign("top"); iwp_tc.setVAlign("middle"); getVAlign = iwp_tc.getVAlign(); insertRow, insertColumn, deleteRow, deleteColumn, getRowCount, getColumnCount IWP_Table iwp_t = null; int numRows = 4; int numCols = 3; String tableName = "MyTable"; int rowCount; int columnCount; iwp_t = wp.insertTable(tableName,numRows,numCols); //create table iwp_t.insertRow(1); //add and delete rows and columns iwp_t.insertColumn(1); iwp_t.deleteRow(2); iwp_t.deleteColumn(2); rowCount = iwp_t.getRowCount(); //get number of rows and columns columnCount = iwp_t.getColumnCount();