ForAll Loop breaks inline images of email in Lotus Notes

0 down vote <> favorite https://stackoverflow.com/questions/52811511/forall-loop-breaks-inline-images-of-email-in-lotus-notes#
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.

https://i.stack.imgur.com/gH1W5.jpg

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

Cheers, Martin

Subject: Set ConvetMIME to False

Before iterating the documents try setting the ConvertMIME property of NotesSession to False.

Example: ns.ConvertMIME = False

Alex

Subject: Is there a wider requirement you are not including?

Is there something that you plan to do within the for loop?

I realise that you’d like to know why the inline images are lost but if you don’t plan to do anything with it, just change the subject, then they aren’t required,and I’d just delete them.

If you do plan to do something with all the items then post that, because perhaps there may be another way to do it that doesn’t cause this issue.

Sometimes, especially in Notes, you don’t get an answer as to why, just ways to stop it from happening…