@kumarpiyush01,
Thanks for the follow-up, we reproduced this locally. The image is not being lost on save; it is never rendered, because a journal item cannot display a cid: image at all.
IPM.Activity is an RTF-body item type. Outlook renders its body from PR_RTF_COMPRESSED and does not resolve cid: references against the attachment table, that resolution happens only for HTML-body messages.
Put the image bytes straight into the RTF as a \pict group. No attachment, no content ID, no AttachFlags.
using System;
using System.IO;
using System.Text;
using Aspose.Email;
using Aspose.Email.Mapi;
using Aspose.Email.Storage.Pst;
string imgPath = @"C:\data\logo.png";
var journal = new MapiJournal
{
Subject = "Call to John",
StartTime = new DateTime(2026, 7, 21, 10, 0, 0, DateTimeKind.Utc),
EndTime = new DateTime(2026, 7, 21, 10, 30, 0, DateTimeKind.Utc),
BriefDescription = "Phone call", // "Entry type" in Outlook
DocumentStatus = MapiJournalDocumentStatus.Saved,
Categories = new[] { "Business" },
};
journal.SetBodyContent(
BuildRtfWithPicture(File.ReadAllBytes(imgPath), 64, 64),
BodyContentType.Rtf);
using (var pst = PersonalStorage.Create(@"C:\data\journal.pst", FileFormatVersion.Unicode))
{
var folder = pst.CreatePredefinedFolder("Journal", StandardIpmFolder.Journal);
folder.AddMapiMessageItem(journal);
}
static string BuildRtfWithPicture(byte[] png, int pxWidth, int pxHeight)
{
var sb = new StringBuilder();
sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Calibri;}}\viewkind4\uc1");
sb.Append(@"\pard\f0\fs22 Phone call with the customer.\par");
// \pngblip for PNG, \jpegblip for JPEG; goal sizes are in twips (1 px = 15 twips at 96 dpi)
sb.Append(@"{\pict\pngblip")
.Append(@"\picw").Append(pxWidth).Append(@"\pich").Append(pxHeight)
.Append(@"\picwgoal").Append(pxWidth * 15).Append(@"\pichgoal").Append(pxHeight * 15)
.Append(' ');
foreach (byte b in png) sb.Append(b.ToString("x2")); // hex, lowercase
sb.Append('}');
sb.Append(@"\par -- end --\par}");
return sb.ToString();
}
Notes on the RTF: the picture data must be plain lowercase hex, \pngblip and \jpegblip are the two formats Outlook accepts directly, and \picwgoal/\pichgoal (twips) control the displayed size while \picw/\pich state the native pixel size. Repeat the {\pict ...} group for each image, anywhere in the text flow.
Adding to a non-journal folder
AddMapiMessageItem enforces that the item’s MessageClass matches the folder’s ContainerClass, which is why you get:
MessageClass of the item to be added (IPM.Activity) doesn’t correspond to the folder’s ContainerClass (IPF.Note).
To place a journal item into an ordinary IPF.Note folder, bypass that check by adding the underlying message:
folder.AddMessage(journal.GetUnderlyingMessage());