Okay, my bad - it does allow setting the property value.
Now, testing with simple MSG files attached:
asposetest.zip (107.8 KB)
test.zip (40.5 KB)
With simple code as follows, i.e. just loading the MSG file and then saving it right back:
using Metadata metadata = new(msgFile);
MsgRootPackage root = metadata.GetRootPackage<MsgRootPackage>();
MsgPackage msg = root.EmailPackage;
metadata.Save();
For the 1st MSG test file, the above causes the MSG content to become messed up.
For the 2nd MSG test file, the Save fails with exception:
Error: The data of attachment can’t be null.
Parameter name: data
at Aspose.Email.Mapi.MapiAttachmentCollection.Add(String name, Byte[] data)
at GroupDocs.Metadata.Formats.Email.MsgRootPackage.(MsgPackage )
at GroupDocs.Metadata.Formats.Email.MsgRootPackage.pfq4rhh3tnxzrhuh6z5nyqfxm3nvff3j?? ?(Stream )