Why can't I replace attachments to original location in RTF?
If you ever tried to manipulate attachments within RTF emails then you are probably aware of this weird issue. Say you have 4 attachments in the email body of a RTF email. Now if you programmatically tries to delete those attachments and place new attachments to their original location then you will see how messy it could be.
The attachments loose their position and can be placed anywhere in the body. So whom to blame? The code.. really? Not exactly but yes to code. This is a weird timing issue and we still do not know the real root cause of the problem. But the below code can do the job for you.
|
Please do let me know if you face any problems with this code.
References:
Attachments Object
https://msdn2.microsoft.com/en-us/library/bb147604.aspx
"To ensure consistent results, always save an item before adding or removing objects in the Attachments collection of the item."
Comments
- Anonymous
July 21, 2008
The comment has been removed