![](/img/trans.png)
[英]Unable to fetch HTML content from mail in Lotus Notes, getMIMEEntity() returns a null even after setConvertMIME(false)
[英]unable to retrive inlines images from the mail body in Lotus Notes
我無法從Lotus Notes中的Java中檢索嵌入式圖像/屏幕截圖
document.getItemValueString('Body')
通過上述功能,我可以檢索郵件正文中可用的文本,而不是嵌入式圖像。
請提供您的建議,以便從郵件正文中檢索嵌入式圖像
提前致謝。
LSP Jyothi
首先:主體是一個NotesRichtextItem。 您將必須使用NotesRichtextItem-方法和屬性來獲取內聯圖像...(如果有的話)。
LotusScript不以任何方式處理內聯圖像。 要獲得它們,您需要:
這樣做涉及很多代碼。 我只是在此處發布了代碼的“關鍵”部分(未經測試,不進行語法檢查,只是作為起點):
編輯:對不起,我不是Java專家,只看到了標簽“ lotusscript”,因此我的示例是LotusScript- Code(應該與Java類似,我認為Base64-操作是用Java內置的別名,不需要使用Mime- Trick)
Dim strDxl as String
Dim strFoundBase64 as String
Dim exporter as NotesDXLExporter
Dim stream as NotesStream
Dim docConvert as NotesDocument
Dim mimeEntity as NotesMimeEntity
Set exporter = session.CreateDXLExporter
exporter.ConvertNotesBitmapsToGIF = True
strDxl = exporter.Export(document)
'- Search through strDxl and find everything that is in the following tags:
'- <gif></gif>, <gif originalformat='notesbitmap'></gif>, <jpeg></jpeg>, <png></png>
strFoundBase64 = ...'assign text between tags
'- use Mime class to convert to binary
Set docConvert = New NotesDocument( document.ParentDatabase )
Set mimeEntity = docConvert.CreateMIMEEntity
Call mimeEntity.SetContentFromBytes(strFoundBase64, "image/gif", ENC_BASE64)
'- Write result to file
Set stream = ses.CreateStream
Call stream.Open( "C:\Temp\image.gif", "binary")
Call mimeEntity.GetContentAsBytes(stream)
Call stream.Close()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.