VBA : Embedded with HTML local images on Lotus Notes -
i'm trying embedded local images on lotus notes using html vba got square cross image (which means : no success)
i have 2 codes, 1 convert local images xml send email. here there :
1-convert images xml
function img64(fichier) dim buffer() byte, intfilenumber, fso object, objxml object, objnode object intfilenumber = freefile set fso = createobject("scripting.filesystemobject") redim buffer(fso.getfile(fichier).size) set fso = nothing open fichier binary #intfilenumber while not eof(intfilenumber) #intfilenumber, , buffer wend close #intfilenumber set objxml = createobject("msxml2.domdocument") '.domdocument set objnode = objxml.createelement("b64") 'msxml2.ixmldomelement objnode.datatype = "bin.base64" objnode.nodetypedvalue = buffer img64 = objnode.text set objnode = nothing set objxml = nothing end function 2 - send email
function sendemail() dim nmailbody string dim nmailsubject string dim nmailrecipient variant dim nmail object dim nsession object dim ndatabase object dim nmime object dim nmailstream object dim nchild object dim nsomemailbodytext string dim amountofrecipients integer bodyhtml = "<img src=""data:image/gif;base64," & img64("c:\users\someone\desktop\image_1.gif") & """/>" nsomemailbodytext = bodyhtml nmailrecipient = "" nmailsubject = "a great email" set nsession = createobject("notes.notessession") set ndatabase = nsession.getdatabase("", "") call ndatabase.openmail set nmail = ndatabase.createdocument nmail.sendto = "hello@world.com" nmail.subject = "hello@world.com" nsession.convertmime = false set nmime = nmail.createmimeentity set nmailstream = nsession.createstream 'vbody containung text in html call nmailstream.writetext(nsomemailbodytext) call nmailstream.writetext("<br>") '------------------------------------------------------------------- set nchild = nmime.createchildentity call nchild.setcontentfromtext(nmailstream, "text/html;charset=iso-8859-1", enc_none) nsession.convertmime = true call nmailstream.close call nmail.save(true, true) 'make mail editable user createobject("notes.notesuiworkspace").editdocument true, nmail 'could send here end function the picture correct , not large neither small. had tried extension/image well. may not due of picture ...
the version of lotus notes i'm using bm lotus notes 8.5 - edition 8.5.2fp4 révision 20111118.0756-fp4 (release 8.5.2fp4)
please !
great thanks

Comments
Post a Comment