Skip to content

Commit 7b415d6

Browse files
committed
Add section about inline image representation in HTML body
1 parent dcc410c commit 7b415d6

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

docs/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Add and remove attachments in an Outlook add-in
33
description: Use various attachment APIs to manage the files or Outlook items attached to the item the user is composing.
4-
ms.date: 03/12/2025
4+
ms.date: 11/27/2025
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -237,6 +237,18 @@ function removeAttachment(attachmentId) {
237237
> [!TIP]
238238
> The `removeAttachmentAsync` method doesn't remove inline attachments from a mail item. To remove an inline attachment, first get the item's body, then remove any references of the attachment from its contents. Use the [Office.Body](/javascript/api/outlook/office.body) APIs to get and set the body of an item.
239239
240+
## Identify inline images in the HTML body of a mail item
241+
242+
While you should call `getAttachmentsAsync` to identify the attachments of a mail item, there may be scenarios where you need to locate an inline image directly from the HTML body of a mail item. For example, you may need to determine the position of an inline image in the body of a message or remove an inline attachment from a message.
243+
244+
In the HTML body of a mail item, inline images are represented by a content ID (`cid`) in the `src` attribute of its corresponding `<img>` element. The `cid` matches the value returned by the [contentId](/javascript/api/outlook/office.attachmentdetailscompose#outlook-office-attachmentdetailscompose-contentid-member) property of an attachment when you call `getAttachmentsAsync`.
245+
246+
The following is an example.
247+
248+
```html
249+
<img src="cid:ee058cc2-ad96-485f-95c7-44b2f40cb987" style="max-width: 1281px;"originalsrc="cid:ee058cc2-ad96-485f-95c7-44b2f40cb987" size="19720" contenttype="image/png">
250+
```
251+
240252
## See also
241253

242254
- [Get an Outlook item's attachments from Exchange](get-attachments-of-an-outlook-item.md)

0 commit comments

Comments
 (0)