You cannot use the Item.Attachments.Add method to programmatically insert attachments into a specific position in an RTF e-mail message in Outlook 2007

Article translations Article translations
Article ID: 967677 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

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.

CAUSE

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 or Item_Send events.

RESOLUTION

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:
967697 Description of the Word 2007 hotfix package (Outlook.msp, Word.msp): February 24, 2009
Note This hotfix package enables attachment-positioning functionality in the ItemSend and Item_Send events. However, this hotfix package does not directly affect the location at which attachments are positioned.

MORE INFORMATION

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.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 967677 - Last Review: February 24, 2009 - Revision: 1.1
APPLIES TO
  • Microsoft Office Outlook 2007
Keywords: 
kbqfe kbexpertiseinter KB967677

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com