0

I do have a Lotus Notes email containing inline images. When I run the following lines of code which simply changes the subject of the email the inline images is lost.

Sub Initialize

Dim ns As New NotesSession
Dim nc As NotesDocumentCollection
Dim nd As NotesDocument

Set nc = ns.Currentdatabase.Unprocesseddocuments()  
Set nd = nc.GetFirstDocument()

    ForAll Items In nd.Items

    End ForAll

Call nd.Replaceitemvalue("Subject", "Forall")
Call nd.Save(True, False)

End Sub

The problem is caused by the ForAll loop which actually doesn't do anything. If the loop is commented out the inline images still remain on the email.

original email with inline image

email after forall loop

I'm hoping any of you guys has an idea or advise how to solve this issue.

Cheers, Martin

atline
  • 28,355
  • 16
  • 77
  • 113

1 Answers1

0

Your message body is probably being converted from Notes rich text to MIME when the item is accessed and then being re-saved, with a loss of fidelity.

Try setting ns.ConvertMIME = false at the beginning of your code.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41