My code is meant to extract the contents of a RichText item as HTML, but I get a runtime error.
Document doc = getExpression().getRefDoc();
Session session = doc.getParentDatabase().getParent();
boolean flag = session.isConvertMime();
session.setConvertMime(false);
Item item = doc.getFirstItem(itemName);
Vector options = new Vector();
String html = "";
if (item.getType() == Item.RICHTEXT)
html = ((RichTextItem) item).convertToHTML(options); // error
session.setConvertMime(flag);
return Utils.toVector(html);
As far as I know, the convertToHTML method isn't defined as abstract.
Can someone please explain why I get the error, and what I can do about it?
This could likely happen if you run the code on a server that doesn't have that method. I think it was added in V10 or thereabouts, so, if you use, say, Designer V11 and run on Domino V9, you'll get that error.