logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • msosvi
    • Posted on Tue 18 Sep 2007 06:43 PM

    "What is needed is a way to tell Domino that this Rich Text field should be as HTML. As far as I know there is no way to do this. I've played with Web Query Save agents and the new MIME Java classes added to Domino 6. But had no luck."

    I hope that this serves you:

    import lotus.domino.*;

    import java.util.Vector;

    public class WebSave extends AgentBase {

    public void NotesMain() {

    try {

    Session session = getSession();

    AgentContext agentContext = session.getAgentContext();

    /*------*/

    Document docContext=agentContext.getDocumentContext();

    session.setConvertMIME(false);

    Item body=docContext.getFirstItem("Body");

    MIMEEntity mime=body.getMIMEEntity();

    Vector headers = mime.getHeaderObjects();

    for (int j = 0; j < headers.size(); j++) {

    MIMEHeader header = (MIMEHeader)headers.elementAt(j);

    if (header.getHeaderName().equals("Content-Type")){

    header.setHeaderVal("text/html");

    }

    }

    docContext.save(true,true);

    session.setConvertMIME(true);

    /*------*/

    } catch(Exception e) {

    e.printStackTrace();

    }

    }

    }

    Thank you for your blog.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: