I am creating messages from MS Word mail merge instrument using Adobe PDFMaker Office COM Addin. I receive a list of messages with pdf-attachments in my Outbox in MS Outlook. But besides the necessary .pdf-attachment all the emails are being sent with "trash" winmail.dat attachment, which confuses the recipients (who do not use Outlook) a lot.
I want to get rid of these winmail.dat attachments in the letters with VBA (the best way), but possibly - with C# (if it's impossible using VBA).
I can set using VBA the format of my mails to plain text, but it doesn't help.
Edit: If one manually deletes winmail.dat, it will be attached again by Outlook during the sending process.
There is a great article Forcing Plain Text With MAPI about the mechanism of getting rid of winmail.dat (how does it work), but unfortunately author used C++, which I am not familiar with.
So, as far as I understood, it is necessary to set 3 MAPI flags to avoid TNEF comletely:
- MAPI_SEND_NO_RICH_INFO
- ENCODING_PREFERENCE
- ENCODING_MIME
I was using OutlookSpy to investigate MAPI flags in my outgoing emails, but even have not found such flags.
I have read also about Redemption library and its possibilities, but I have not found any hints about these MAPI flags either.
Can anybody explain or just suggest: how to set this flags using VBA or C#?
or probably in other way get rid of winmail.dat sending?
Set the special named property UseTnef (DASL name
http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B
) to false usingMailItem.PropertyAccessor.SetProperty
.