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.*;
import java.net.*;

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
     }
}

insertBookmark, enumerateBookmark, findBookmark, deleteBookmark 

        IWP_Bookmark iwp_b;
        IWP_Enumerator BMs;
        String BookmarkName = "BookmarkName";
        String BookmarkName2 = "BookmarkName2";
        String indBM = "";

        iwp_b = wp.insertBookmark(BookmarkName); //insert first bookmark 
        wp.splitParagraph();
        iwp_b = wp.insertBookmark(BookmarkName2);//insert second bookmark 
        BMs = wp.enumerateBookmarks();
        while (BMs.hasMoreNames())             //loop through bookmarks and print names
        {
            indBM = BMs.nextName();
            System.out.println("Bookmark= "+indBM);
        }
        iwp_b = wp.findBookmark(BookmarkName); //get handle to individual bookmark 
        wp.deleteBookmark(BookmarkName);        //delete bookmark 

insertClickHere, enumerateClickHere, findClickHere, deleteClickHere 

        IWP_ClickHere iwp_ch;
        IWP_Enumerator CHBs;
        String clickhereName = "ClickHereName";
        String clickhereName2 = "ClickHereName2";
        String prompt = "This is the first prompt";
        String prompt2 = "This is the second prompt";
        String indCHB = "";

        iwp_ch = wp.insertClickHere(clickhereName,prompt); //insert first click here
        wp.splitParagraph();
        iwp_ch = wp.insertClickHere(clickhereName2,prompt2);//insert second click here
        CHBs = wp.enumerateClickHeres();
        while (CHBs.hasMoreNames())             //loop through click heres and print names
        {
            indCHB = CHBs.nextName();
            System.out.println("Click Here= "+indCHB);
        }
        iwp_ch = wp.findClickHere(clickhereName); //get handle to individual click here
        wp.deleteClickHere(clickhereName);        //delete click here

insertDate, enumerateDate, findDate, deleteDate 

        IWP_Date iwp_d;
        IWP_Enumerator dates;
        String dateFormat = "M/D/Y";
        String dateName = "Date Name";
        String dateName2 = "Date Name2";
        String indDate = "";

        iwp_d = wp.insertDate(dateName, dateFormat); //insert first date
        wp.splitParagraph();
        iwp_d = wp.insertDate(dateName2, dateFormat); //insert second date
        dates = wp.enumerateDates();
        while (dates.hasMoreNames())                 //loop through dates and print date name
        {
            indDate = dates.nextName();
            System.out.println("Date= "+indDate);
        }
        iwp_d = wp.findDate(dateName);             //get handle to specific date
        wp.deleteDate(dateName);                    //delete date

insertHorizontalLine, enumerateHorizontalLine, findHorizontalLine, deleteHorizontalLine 

        IWP_HorizontalLine iwp_h;
        IWP_Enumerator HLs;
        String HorizontalLineName = "HorizontalLineName";
        String HorizontalLineName2 = "HorizontalLineName2";
        String indHL = "";

        iwp_h = wp.insertHorizontalLine(HorizontalLineName); //insert first horizontal line
        wp.splitParagraph();
        iwp_h = wp.insertHorizontalLine(HorizontalLineName2);//insert second horizontal line
        HLs = wp.enumerateHorizontalLines();
        while (HLs.hasMoreNames())             //loop through horizontal lines and print names
        {
            indHL = HLs.nextName();
            System.out.println("Horizontal Line= "+indHL);
        }
        iwp_h = wp.findHorizontalLine(HorizontalLineName); //get handle to individual horizontal line
        wp.deleteHorizontalLine(HorizontalLineName);        //delete horizontal line

insertImage, enumerateImage, findImage, deleteImage 

        IWP_Image iwp_i;
        IWP_Enumerator Is;
        String ImageName = "face1.gif";
        String ImageName2 = "face2.gif";
        String indI = "";
        URL documentBase;          //need to add java.net.* to get an URL type
        int lastSlashMarker;
        String slash = "/";
        String imagePath;
        String urlString;
        String name = "image";
        String name2 = "image2";

        documentBase = getDocumentBase();       //get path to current directory
        urlString = documentBase.toString();
        lastSlashMarker = urlString.lastIndexOf(slash);
        imagePath = urlString.substring(0,lastSlashMarker+1);

        iwp_i = wp.insertImage(name, imagePath + ImageName); //insert first image
        wp.splitParagraph();
        iwp_i = wp.insertImage(name2, imagePath + ImageName2);//insert second image
        Is = wp.enumerateImages();
        while (Is.hasMoreNames())             //loop through images and print names
        {
            indI = Is.nextName();
            System.out.println("Image= "+indI);
        }
        iwp_i = wp.findImage(name); //get handle to individual image
        wp.deleteImage(name);        //delete image

insertLineBreak

    boolean lineBreak;

    wp.insertText("First line");
    lineBreak = wp.insertLineBreak();   //insert line break
    System.out.println(""+lineBreak);   //print out if linebreak worked
    wp.insertText("Second Line"); 

insertLink, enumerateLink, findLink, deleteLink

        IWP_Link iwp_i;
        IWP_Enumerator Ls;
        String LinkName = "LinkName";
        String LinkName2 = "LinkName2";
        String indL = "";
        String URLpathname = "http://www.cnn.com";
        String URLpathname2 = "http://www.mayohealth.org";

        wp.insertText(URLpathname);
        wp.home(true);
        iwp_i = wp.insertLink(LinkName,URLpathname); //insert first link
        wp.end(false);
        wp.splitParagraph();
        wp.insertText(URLpathname2);
        wp.home(true);
        iwp_i = wp.insertLink(LinkName2,URLpathname2);//insert second link
        wp.end(false);
        Ls = wp.enumerateLinks();
        while (Ls.hasMoreNames())             //loop through links and print names
        {
            indL = Ls.nextName();
            System.out.println("Link= "+indL);
        }
        iwp_i = wp.findLink(LinkName); //get handle to individual link
        wp.deleteLink(LinkName);        //delete link