Loading some .msg files to save as .mht will throw NullRefrenceException, sample project to reproduce the error is attached:
WindowsApplication1.zip (361.9 KB)
Seems the root of issue is from MhtFormatOptions.RenderTaskFields
Internally, if we set MhtFormatOptions enums to format the target Mht, and one is not approperiate to the source msg (ie RenderTaskFields for a IPM.Contact Msg) it should be ignored instead of throwing exception.
A feature was requested to add RenderTaskFields to the HtmlSaveOptions so we can save in both Mht and Htm the same, no idea if added for the upcoming 23.1 build or not, but if it’s already added, it might suffer from the same issue.