ms_outlook_attachment {Microsoft365R}R Documentation

Outlook mail attachment

Description

Class representing an attachment in Outlook.

Format

An R6 object of class ms_outlook_attachment, inheriting from ms_outlook_object, which in turn inherits from ms_object.

Fields

Methods

Initialization

Creating new objects of this class should be done via the the get_attachment(), list_attachments() or create_attachment() methods ms_outlook_email class. Calling the new() method for this class only constructs the R object; it does not call the Microsoft Graph API to retrieve or create the actual attachment.

In general, you should not need to interact directly with this class, as the ms_outlook_email class exposes convenience methods for working with attachments. The only exception is to download an attachment in a reliable way (not involving the attachment name); see the example below.

See Also

ms_outlook, ms_outlook_email

Microsoft Graph overview, Outlook API reference

Examples

## Not run: 

outl <- get_personal_outlook()

em <- outl$get_inbox$get_email("email_id")

# download the first attachment in an email
atts <- em$list_attachments()
atts[[1]]$download()


## End(Not run)

[Package Microsoft365R version 2.4.0 Index]