2014-02-12 33 views
1

嗨,大家好,我正在蓮花筆記上工作內聯附件(如郵件正文內的圖片)。基於對這個問題的指導(can anyone please tell how to deal with inline images in lotus notes正試圖將郵件正文從Richtext轉換爲在當我搜索我得到將RIchText轉換爲java中使用多米諾設計器的MIME

NotesException: Conversion To MIME Failed: 
[1FD8:0047-1DDC] 12-02-2014 18:30:23 HTTP JVM: HTMLAPI Problem converting to HTML. 

服務器部署在MIME using.Domino版本8.5.3

m_session.setConvertMIME(false); 

doc.removeItem("$KeepPrivate"); 

doc.convertToMIME(doc.CVT_RT_TO_HTML,0); 

MIMEEntity me=doc.getMIMEEntity("body"); 

代碼工作正常時agent.But嘗試了所有的材料說這是蓮花notes.can任何人的問題請告訴如何解決this.or有沒有變通的this.Please幫助

回答

1

我得到了一個工作富文本>默SSJS,我想這可以適用於Java的

function convertBodyToMimeAndSave(documentToConvert){ 

    // Create a temporary document 
    // Calling convertToMime makes a MIME output of the full 
    /// document and puts it in body. If you have other 
    // fields than body in the original document, that 
    // will produce undesirable added content to the body 
    var tmp = database.createDocument(); 

    // Put the original richtext in it 
    var rt = targetDocument.getFirstItem("Body") 
    if(!rt) return targetDocument 
    rt.copyItemToDocument(tmp) 

    // Convert the temporary document to MIME 
    tmp.convertToMIME(2) 

    // Copy all Items (that is, the Body) back to the original document 
    // (copying the Body specifically seemed to make the script crash) 
    tmp.copyAllItems (targetDocument, true) 


    targetDocument.closeMIMEEntities(true, "Body") 
    targetDocument.save() 
} 
轉換腳本