Consider the following scenario:
- In Microsoft Office Outlook 2007, you try to send a Rich Text Format (RTF) e-mail message. Additionally, one or more attachments are contained in the body of the message.
- You create a custom solution that implements the Application_ItemSend event or the Item_Send event in the Outlook object model and that uses the Item.Attachments.Add method to attach files in specific positions in the message body.
When you run the custom solution in this scenario, the attachments are not inserted in the positions that you specified in the message body.
Outlook 2007 lets you specify the positions of attachments when the attachments are programmatically attached to the messages. However, the positioning functionality does not work in the ItemSend
This problem is fixed in the Word 2007 hotfix package that is dated February 24, 2009.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
Description of the Word 2007 hotfix package (Outlook.msp, Word.msp): February 24, 2009
This hotfix package enables attachment-positioning functionality in the ItemSend
events. However, this hotfix package does not directly affect the location at which attachments are positioned.
For more information about this problem, note the following:
- If Outlook 2003 is configured to use Word as the e-mail editor, and a custom solution uses the Outlook object model to remove attachments from Rich Text e-mail messages, an attachment placeholder tag (\objattph) in the underlying RTF stream may not be removed. If you then use the Outlook object model to insert attachments in these e-mail messages, Word may insert attachments at the placeholder position, regardless of the position that you specify in the Outlook object model.
Note This Outlook 2003 problem cannot be fixed.
- If Word is configured as the e-mail editor in Outlook 2003 and in earlier versions of Outlook, attachments are added to the end of the message body regardless of the specified positions. The native RTF handling in those earlier versions of Outlook does not directly correspond to RTF-handling functionality in Word. Word and those earlier versions of Outlook use the different ways to track character positions and the insertion point. Because Outlook 2007 now uses Word as the editor for all messages, this issue is more prevalent.
There are some positions in the Word character stream at which you cannot insert attachments, such as at the end of a table row. When Word tries to insert an attachment at the end of a table row, Word backs up one position at a time (for a maximum of 10) until it either finds an available position or until it arrives at the beginning of the document. If Word still cannot find an available position, it inserts the attachment at the end of the document.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 967677 - Last Review: February 24, 2009 - Revision: 1.1
- Microsoft Office Outlook 2007
|kbqfe kbexpertiseinter KB967677|