Represents a message attachment. More...

Inherits Aspose::Email::Mapi::MapiPropertyContainer.

Public Member Functions

virtual System::String get_ItemId ()
 The item id, uses with a server More...
 
virtual void set_ItemId (System::String value)
 The item id, uses with a server More...
 
virtual bool get_IsInline ()
 Gets a value indicating whether the attachment is inline or regular. If inline returns true, otherwise false. More...
 
bool get_IsReference ()
 Gets a value indicating whether the attachment is stored as a reference rather than being embedded in the email. More...
 
System::String get_Extension ()
 Gets a filename extension that indicates the document type of an attachment. More...
 
System::SharedPtr< MapiPropertyStreamget_PropertyStream ()
 Gets the property stream. More...
 
System::SharedPtr< MapiPropertyCollectionget_SubStorages ()
 Gets the sub storages. More...
 
System::String get_FileName ()
 Gets an attachment's base filename and extension, excluding path. More...
 
System::String get_LongFileName ()
 Gets an attachment's long filename and extension, excluding path. More...
 
System::String get_DisplayName ()
 Gets the display name of the ole object in an attachment. More...
 
void set_DisplayName (System::String value)
 Gets the display name of the ole object in an attachment. More...
 
System::String get_MimeTag ()
 Gets formatting information about a Multipurpose Internet Mail Extensions (MIME) attachment. More...
 
System::ArrayPtr< uint8_t > get_BinaryData ()
 Gets binary attachment data. More...
 
void set_BinaryData (System::ArrayPtr< uint8_t > value)
 Sets binary attachment data. More...
 
System::SharedPtr< System::Object > get_Content ()
 Gets the content. More...
 
System::String get_ContentId ()
 
System::SharedPtr< MapiObjectPropertyget_ObjectData ()
 Gets an attachment object typically accessed through the OLE IStorage interface. More...
 
System::SharedPtr< MapiPropertyCollectionget_NamedProperties ()
 Gets the named properties of message. More...
 
bool get_Hidden ()
 
 MapiAttachment ()
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String itemId, System::String attachName, System::ArrayPtr< uint8_t > attachData, int32_t count)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String itemId, System::String attachName, System::ArrayPtr< uint8_t > attachData, System::String mediaType, int32_t count)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String attachName, System::ArrayPtr< uint8_t > attachData, int32_t count, OutlookMessageFormat format, bool preserveDates, int32_t codePage)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String attachName, System::SharedPtr< MapiMessageItemBase > attachMsg, int32_t count, OutlookMessageFormat format, bool preserveDates, int32_t codePage)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String attachName, System::String attachContentId, System::ArrayPtr< uint8_t > attachData, int32_t count, OutlookMessageFormat format, bool preserveDates)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::String attachName, System::SharedPtr< MapiMessage > attachMsg, int32_t count, OutlookMessageFormat format, bool preserveDates)
 Initializes a new instance of the MapiAttachment class. More...
 
 MapiAttachment (System::SharedPtr< ReferenceAttachment > refAttach, int32_t codePage, int32_t count, OutlookMessageFormat format, bool preserveDates)
 
void SetNamedPropertyMapping (System::SharedPtr< MapiNamedPropertyMappingStorage > value)
 Sets the named property mapping. More...
 
void SaveToTnef (System::String filename)
 Save attachment to tnef content. More...
 
void SaveToTnef (System::SharedPtr< System::IO::Stream > stream)
 Save attachment to tnef content. More...
 
void SaveToTnefInternal (System::SharedPtr< System::IO::Stream > stream)
 
void Save (System::String filename)
 Save attachment content. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream)
 Save attachment content. More...
 
void SaveInternal (System::SharedPtr< System::IO::Stream > stream)
 Save attachment content. More...
 
void SetProperty (System::SharedPtr< MapiProperty > value) override
 Sets the property. More...
 
void RemoveProperty (int64_t tag)
 Provides correctly removing property from all collections. More...
 
System::SharedPtr< Nodes::IMapiNode > CreateMapiNode (System::String key) override
 Creates the mapi node. More...
 
void SetOwner (System::SharedPtr< MapiMessageItemBase > owner)
 Sets the owner. More...
 
int32_t GetSize ()
 Gets the size of the attachment. Contains the sum, in bytes, of the sizes of all properties on an attachment. The sum contained in PR_ATTACH_SIZE property includes the size of the PR_ATTACH_DATA_BIN or PR_ATTACH_DATA_OBJ property. More...
 
System::SharedPtr< MapiAttachmentClone ()
 
System::SharedPtr< System::IO::MemoryStream > ToMemoryStream ()
 
System::SharedPtr< MapiMessageToMapiMessage ()
 
System::SharedPtr< MapiPropertyGetProperty (System::SharedPtr< PropertyDescriptor > pd) override
 Gets MAPI property by property descriptor. More...
 
bool TryGetNamedProperty (System::SharedPtr< MapiProperty > mapiProperty, System::SharedPtr< MapiNamedProperty > &mapiNamedProperty) override
 If MapiNamedPropertyMappingStorage is available, initializes and returns MapiNamedProperty, otherwise null. More...
 
void SetProperty (System::SharedPtr< PropertyDescriptor > pd, System::SharedPtr< System::Object > value) override
 Sets MAPI property. More...
 
- Public Member Functions inherited from Aspose::Email::Mapi::MapiPropertyContainer
virtual System::SharedPtr< MapiPropertyCollectionget_Properties ()
 Gets the collection of properties. More...
 
virtual int32_t get_CodePage ()
 Gets the code page. More...
 
System::SharedPtr< System::Text::Encoding > get_CurrentEncoding ()
 
 MapiPropertyContainer ()
 Initializes a new instance of the MapiPropertyContainer class. More...
 
 MapiPropertyContainer (System::SharedPtr< MapiPropertyCollection > properties)
 Initializes a new instance of the MapiPropertyContainer class. More...
 
System::SharedPtr< MapiPropertyCollectionGetSubStorages ()
 
System::String TryGetPropertyString (int64_t tag, int32_t codepage)
 Try to get a property data as string with specified tag and code page. More...
 
System::ArrayPtr< uint8_t > TryGetPropertyData (int64_t tag)
 Try to get the property data with specified tag key. More...
 
System::String TryGetPropertyString (int64_t tag)
 Try to get a property data as string with specified tag. More...
 
System::String GetPropertyString (int64_t tag, int32_t codepage)
 Gets the string value of the property specified by tag. More...
 
System::String GetPropertyString (int64_t tag)
 Gets the string value of the property specified by tag. More...
 
System::ArrayPtr< uint8_t > GetPropertyBytes (int64_t tag)
 Gets the string value of the property specified by tag. More...
 
System::Nullable< int32_t > GetPropertyInt32 (int64_t tag)
 Gets the int32 value of the property specified by tag. More...
 
System::Nullable< int64_t > GetPropertyLong (int64_t tag)
 Gets the value of the property specified by tag as Long (int64) type. More...
 
System::Nullable< int16_t > GetPropertyShort (int64_t tag)
 Gets the value of the property specified by tag as Short type. More...
 
System::Nullable< bool > GetPropertyBoolean (int64_t tag)
 Gets the value of the property specified by tag as Boolean type. More...
 
System::Nullable< System::DateTime > GetPropertyDateTime (int64_t key)
 Gets the value of the property specified by tag as DateTime type. More...
 
bool IsStoreUnicodeOk ()
 Determines if string properties are Unicode encoded or not. More...
 
bool TryGetPropertyString (int64_t tag, System::String &value, int32_t codepage)
 Gets the value of the specified property as String type. A return value indicates whether the operation succeeded. More...
 
bool TryGetPropertyString (int64_t tag, System::String &value)
 Gets the value of the specified property as String type. A return value indicates whether the operation succeeded. More...
 
bool TryGetPropertyDateTime (int64_t tag, System::DateTime &value)
 Gets the value of the specified property as DateTime type. A return value indicates whether the operation succeeded. More...
 
bool TryGetPropertyLong (int64_t tag, int64_t &value)
 Gets the value of the specified property as Long type. A return value indicates whether the operation succeeded. More...
 
bool TryGetPropertyInt32 (int64_t tag, int32_t &value)
 Gets the value of the specified property as Int32 type. A return value indicates whether the operation succeeded. More...
 
void SetProperty (int64_t tag, System::ArrayPtr< uint8_t > data)
 Set the property. More...
 
void SetProperty (int64_t tag, System::String value, OutlookMessageFormat format)
 Set the string property. More...
 
void SetProperty (int64_t tag, System::String value, bool isUnicode)
 Set the string property. More...
 
void SetProperty (int64_t tag, System::String value, System::SharedPtr< System::Text::Encoding > nonUnicodeEncoding)
 Set the string property. More...
 
void SetProperty (int64_t tag, System::String value)
 Set the string property with CurrentEncoding More...
 
void SetProperty (int64_t tag, System::DateTime dateTime)
 Set the datetime property. More...
 
void SetPropertyLong (int64_t tag, int64_t value)
 Set the long property. More...
 

Static Public Member Functions

static System::SharedPtr< MapiAttachmentLoadFromTnef (System::String fileName)
 Load MapiAttachment from file with tnef content. More...
 
static System::SharedPtr< MapiAttachmentLoadFromTnef (System::SharedPtr< System::IO::Stream > stream)
 Load MapiAttachment from stream with tnef content. More...
 

Public Attributes

System::SharedPtr< MapiNamedPropertyMappingStoragenamedPropertyMappingStorage
 The named property mapping storage. More...
 
- Public Attributes inherited from Aspose::Email::Mapi::MapiPropertyContainer
int32_t codePage
 The code page. More...
 
System::SharedPtr< MapiPropertyCollectionpropertyDictionary
 The property dictionary. More...
 

Protected Member Functions

virtual ~MapiAttachment ()
 
- Protected Member Functions inherited from Aspose::Email::Mapi::MapiPropertyContainer
virtual ~MapiPropertyContainer ()
 

Friends

class Aspose::Email::Clients::Graph::GraphClientV1
 
class Aspose::Email::Clients::Graph::V1::Commands::CreateAttachmentCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::CreateTaskAttachmentCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::GetAttachmentCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::GetTaskAttachmentCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::ListAttachmentsCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::ListTaskAttachmentsCommand
 

Additional Inherited Members

- Static Public Attributes inherited from Aspose::Email::Mapi::MapiPropertyContainer
static const int32_t DefaultCodePage = 20127
 

Detailed Description

Represents a message attachment.

This class encapsulates an attachment, providing methods to access and manipulate its properties.

This code example loads a message from a file and iterates over each attachment. If an attachment is inline, it prints its display name. If not, it checks if the attachment is an embedded message. If so, it saves the attachment to a memory stream. If not, it saves to a specified path.

[C#]

// Load the MAPI message from the specified file
var msg = MapiMessage.Load("source.msg");
// Iterate over each attachment in the MAPI message
foreach (var mapiAttachment in msg.Attachments)
{
// Check if the attachment is inline
if (mapiAttachment.IsInline)
{
// If inline, print its display name
Console.WriteLine($"Inline: {mapiAttachment.DisplayName}");
}
else
{
// If not inline
// Check if the attachment contains an embedded message
if (mapiAttachment.ObjectData != null && mapiAttachment.ObjectData.IsOutlookMessage)
{
// If it's an embedded message
// Save the attachment to a memory stream
using (MemoryStream ms = new MemoryStream())
{
mapiAttachment.Save(ms);
ms.Position = 0;
// Load the embedded message from the memory stream
var embeddedMessage = MapiMessage.Load(ms);
}
}
else
{
// If it's not an embedded message
// Save the attachment to the specified path
mapiAttachment.Save(Path.Combine(path, mapiAttachment.LongFileName));
}
}
}

[Visual Basic]

' Load the MAPI message from the specified file
Dim msg = MapiMessage.Load("source.msg")
' Iterate over each attachment in the MAPI message
For Each mapiAttachment In msg.Attachments
' Check if the attachment is inline
If mapiAttachment.IsInline Then
' If inline, print its display name
Console.WriteLine($"Inline: {mapiAttachment.DisplayName}")
Else
' If not inline
' Check if the attachment contains an embedded message
If mapiAttachment.ObjectData IsNot Nothing AndAlso mapiAttachment.ObjectData.IsOutlookMessage Then
' If it's an embedded message
' Save the attachment to a memory stream
Using ms As New MemoryStream()
mapiAttachment.Save(ms)
ms.Position = 0
' Load the embedded message from the memory stream
Dim embeddedMessage = MapiMessage.Load(ms)
End Using
Else
' If it's not an embedded message
' Save the attachment to the specified path
mapiAttachment.Save(Path.Combine(path, mapiAttachment.LongFileName))
End If
End If
Next

Constructor & Destructor Documentation

◆ MapiAttachment() [1/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( )

Initializes a new instance of the MapiAttachment class.

◆ MapiAttachment() [2/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  itemId,
System::String  attachName,
System::ArrayPtr< uint8_t >  attachData,
int32_t  count 
)

Initializes a new instance of the MapiAttachment class.

Parameters
itemIdThe attachment id
attachNameName of the attach.
attachDataThe attach data.
countThe attachments quantity.

◆ MapiAttachment() [3/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  itemId,
System::String  attachName,
System::ArrayPtr< uint8_t >  attachData,
System::String  mediaType,
int32_t  count 
)

Initializes a new instance of the MapiAttachment class.

Parameters
itemIdThe attachment id
attachNameName of the attach.
attachDataThe attach data.
mediaTypeThe media type name.
countThe attachments quantity.

◆ MapiAttachment() [4/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  attachName,
System::ArrayPtr< uint8_t >  attachData,
int32_t  count,
OutlookMessageFormat  format,
bool  preserveDates,
int32_t  codePage 
)

Initializes a new instance of the MapiAttachment class.

Parameters
attachNameName of the attach.
attachDataThe attach data.
countThe count.
formatThe format.
preserveDatesIf set to true [preserve dates].
codePage

◆ MapiAttachment() [5/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  attachName,
System::SharedPtr< MapiMessageItemBase attachMsg,
int32_t  count,
OutlookMessageFormat  format,
bool  preserveDates,
int32_t  codePage 
)

Initializes a new instance of the MapiAttachment class.

Parameters
attachNameName of the attach.
attachMsg
countThe count.
formatThe format.
preserveDatesIf set to true [preserve dates].
codePage

◆ MapiAttachment() [6/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  attachName,
System::String  attachContentId,
System::ArrayPtr< uint8_t >  attachData,
int32_t  count,
OutlookMessageFormat  format,
bool  preserveDates 
)

Initializes a new instance of the MapiAttachment class.

Parameters
attachNameName of the attach.
attachContentIdContentId of the attachment.
attachDataThe attach data.
countThe count.
formatThe format.
preserveDatesIf set to true [preserve dates].

◆ MapiAttachment() [7/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::String  attachName,
System::SharedPtr< MapiMessage attachMsg,
int32_t  count,
OutlookMessageFormat  format,
bool  preserveDates 
)

Initializes a new instance of the MapiAttachment class.

Parameters
attachNameName of the attach.
attachMsgThe mapi message that will be attached.
countThe count.
formatThe format.
preserveDatesIf set to true [preserve dates].

◆ MapiAttachment() [8/8]

Aspose::Email::Mapi::MapiAttachment::MapiAttachment ( System::SharedPtr< ReferenceAttachment refAttach,
int32_t  codePage,
int32_t  count,
OutlookMessageFormat  format,
bool  preserveDates 
)

◆ ~MapiAttachment()

virtual Aspose::Email::Mapi::MapiAttachment::~MapiAttachment ( )
protectedvirtual

Member Function Documentation

◆ Clone()

System::SharedPtr<MapiAttachment> Aspose::Email::Mapi::MapiAttachment::Clone ( )

◆ CreateMapiNode()

System::SharedPtr<Nodes::IMapiNode> Aspose::Email::Mapi::MapiAttachment::CreateMapiNode ( System::String  key)
overridevirtual

Creates the mapi node.

Parameters
keyThe node key.
Returns
The IMapiNode interface.

Reimplemented from Aspose::Email::Mapi::MapiPropertyContainer.

◆ get_BinaryData()

System::ArrayPtr<uint8_t> Aspose::Email::Mapi::MapiAttachment::get_BinaryData ( )

Gets binary attachment data.

The binary data.

◆ get_Content()

System::SharedPtr<System::Object> Aspose::Email::Mapi::MapiAttachment::get_Content ( )

Gets the content.

The content.

◆ get_ContentId()

System::String Aspose::Email::Mapi::MapiAttachment::get_ContentId ( )

◆ get_DisplayName()

System::String Aspose::Email::Mapi::MapiAttachment::get_DisplayName ( )

Gets the display name of the ole object in an attachment.

The display name.

◆ get_Extension()

System::String Aspose::Email::Mapi::MapiAttachment::get_Extension ( )

Gets a filename extension that indicates the document type of an attachment.

The extension.

◆ get_FileName()

System::String Aspose::Email::Mapi::MapiAttachment::get_FileName ( )

Gets an attachment's base filename and extension, excluding path.

The file name.

◆ get_Hidden()

bool Aspose::Email::Mapi::MapiAttachment::get_Hidden ( )

◆ get_IsInline()

virtual bool Aspose::Email::Mapi::MapiAttachment::get_IsInline ( )
virtual

Gets a value indicating whether the attachment is inline or regular. If inline returns true, otherwise false.

◆ get_IsReference()

bool Aspose::Email::Mapi::MapiAttachment::get_IsReference ( )

Gets a value indicating whether the attachment is stored as a reference rather than being embedded in the email.

This property determines if the attachment is referenced by its file path or a web link based on the PidTagAttachMethod MAPI property. The following values indicate a reference-based attachment:

  • 0x00000002 - afByReference: The attachment is identified by a fully qualified file path, accessible to recipients with shared access to the file server.
  • 0x00000004 - afByReferenceOnly: The attachment is identified solely by its fully qualified file path.
  • 0x00000007 - afByWebReference: The attachment is identified by a web link, with the PidNameAttachmentProviderType specifying the web service API handling the attachment.

If the attachment does not match these criteria, this property returns false.

true if the attachment is stored as a reference; otherwise, false.

◆ get_ItemId()

virtual System::String Aspose::Email::Mapi::MapiAttachment::get_ItemId ( )
virtual

The item id, uses with a server

◆ get_LongFileName()

System::String Aspose::Email::Mapi::MapiAttachment::get_LongFileName ( )

Gets an attachment's long filename and extension, excluding path.

The long file name.

◆ get_MimeTag()

System::String Aspose::Email::Mapi::MapiAttachment::get_MimeTag ( )

Gets formatting information about a Multipurpose Internet Mail Extensions (MIME) attachment.

The mime tag.

◆ get_NamedProperties()

System::SharedPtr<MapiPropertyCollection> Aspose::Email::Mapi::MapiAttachment::get_NamedProperties ( )

Gets the named properties of message.

The collection of named properties.

◆ get_ObjectData()

System::SharedPtr<MapiObjectProperty> Aspose::Email::Mapi::MapiAttachment::get_ObjectData ( )

Gets an attachment object typically accessed through the OLE IStorage interface.

The object data.

◆ get_PropertyStream()

System::SharedPtr<MapiPropertyStream> Aspose::Email::Mapi::MapiAttachment::get_PropertyStream ( )

Gets the property stream.

The property stream.

◆ get_SubStorages()

System::SharedPtr<MapiPropertyCollection> Aspose::Email::Mapi::MapiAttachment::get_SubStorages ( )

Gets the sub storages.

The sub storages.

◆ GetProperty()

System::SharedPtr<MapiProperty> Aspose::Email::Mapi::MapiAttachment::GetProperty ( System::SharedPtr< PropertyDescriptor pd)
overridevirtual

Gets MAPI property by property descriptor.

Parameters
pdProperty descriptor for looked property
Returns
Mapi property if it is found, otherwise null.

Reimplemented from Aspose::Email::Mapi::MapiPropertyContainer.

◆ GetSize()

int32_t Aspose::Email::Mapi::MapiAttachment::GetSize ( )

Gets the size of the attachment. Contains the sum, in bytes, of the sizes of all properties on an attachment. The sum contained in PR_ATTACH_SIZE property includes the size of the PR_ATTACH_DATA_BIN or PR_ATTACH_DATA_OBJ property.

Returns

◆ LoadFromTnef() [1/2]

static System::SharedPtr<MapiAttachment> Aspose::Email::Mapi::MapiAttachment::LoadFromTnef ( System::SharedPtr< System::IO::Stream >  stream)
static

Load MapiAttachment from stream with tnef content.

Parameters
streamSource stream
Returns
MapiAttachment

◆ LoadFromTnef() [2/2]

static System::SharedPtr<MapiAttachment> Aspose::Email::Mapi::MapiAttachment::LoadFromTnef ( System::String  fileName)
static

Load MapiAttachment from file with tnef content.

Parameters
fileNameSource file path.
Returns
MapiAttachment
Exceptions
ArgumentNullExceptionIf fileName is null.

◆ RemoveProperty()

void Aspose::Email::Mapi::MapiAttachment::RemoveProperty ( int64_t  tag)

Provides correctly removing property from all collections.

Parameters
tagThe tag of MapiProperty.

◆ Save() [1/2]

void Aspose::Email::Mapi::MapiAttachment::Save ( System::SharedPtr< System::IO::Stream >  stream)

Save attachment content.

Parameters
streamThe stream to save.

◆ Save() [2/2]

void Aspose::Email::Mapi::MapiAttachment::Save ( System::String  filename)

Save attachment content.

Parameters
filenameThe file name to save.

◆ SaveInternal()

void Aspose::Email::Mapi::MapiAttachment::SaveInternal ( System::SharedPtr< System::IO::Stream >  stream)

Save attachment content.

Parameters
streamThe stream to save.

◆ SaveToTnef() [1/2]

void Aspose::Email::Mapi::MapiAttachment::SaveToTnef ( System::SharedPtr< System::IO::Stream >  stream)

Save attachment to tnef content.

Parameters
streamThe stream to save.

◆ SaveToTnef() [2/2]

void Aspose::Email::Mapi::MapiAttachment::SaveToTnef ( System::String  filename)

Save attachment to tnef content.

Parameters
filenameThe file name to save.

◆ SaveToTnefInternal()

void Aspose::Email::Mapi::MapiAttachment::SaveToTnefInternal ( System::SharedPtr< System::IO::Stream >  stream)

◆ set_BinaryData()

void Aspose::Email::Mapi::MapiAttachment::set_BinaryData ( System::ArrayPtr< uint8_t >  value)

Sets binary attachment data.

The binary data.

◆ set_DisplayName()

void Aspose::Email::Mapi::MapiAttachment::set_DisplayName ( System::String  value)

Gets the display name of the ole object in an attachment.

The display name.

◆ set_ItemId()

virtual void Aspose::Email::Mapi::MapiAttachment::set_ItemId ( System::String  value)
virtual

The item id, uses with a server

◆ SetNamedPropertyMapping()

void Aspose::Email::Mapi::MapiAttachment::SetNamedPropertyMapping ( System::SharedPtr< MapiNamedPropertyMappingStorage value)

Sets the named property mapping.

Parameters
valueThe MapiNamedPropertyMappingStorage.

◆ SetOwner()

void Aspose::Email::Mapi::MapiAttachment::SetOwner ( System::SharedPtr< MapiMessageItemBase owner)

Sets the owner.

Parameters
ownerThe owner message.

◆ SetProperty() [1/2]

void Aspose::Email::Mapi::MapiAttachment::SetProperty ( System::SharedPtr< MapiProperty value)
overridevirtual

Sets the property.

Parameters
valueThe property.
Exceptions
ArgumentNullExceptionIf value is null.
ArgumentExceptionIf property data is null.
InvalidOperationExceptionIf data type is not supported.

Reimplemented from Aspose::Email::Mapi::MapiPropertyContainer.

◆ SetProperty() [2/2]

void Aspose::Email::Mapi::MapiAttachment::SetProperty ( System::SharedPtr< PropertyDescriptor pd,
System::SharedPtr< System::Object >  value 
)
overridevirtual

Sets MAPI property.

Parameters
pdThe property descriptor.
valueThe property data.

Reimplemented from Aspose::Email::Mapi::MapiPropertyContainer.

◆ ToMapiMessage()

System::SharedPtr<MapiMessage> Aspose::Email::Mapi::MapiAttachment::ToMapiMessage ( )

◆ ToMemoryStream()

System::SharedPtr<System::IO::MemoryStream> Aspose::Email::Mapi::MapiAttachment::ToMemoryStream ( )

◆ TryGetNamedProperty()

bool Aspose::Email::Mapi::MapiAttachment::TryGetNamedProperty ( System::SharedPtr< MapiProperty mapiProperty,
System::SharedPtr< MapiNamedProperty > &  mapiNamedProperty 
)
overridevirtual

If MapiNamedPropertyMappingStorage is available, initializes and returns MapiNamedProperty, otherwise null.

Parameters
mapiProperty
mapiNamedProperty
Returns

Reimplemented from Aspose::Email::Mapi::MapiPropertyContainer.

Friends And Related Function Documentation

◆ Aspose::Email::Clients::Graph::GraphClientV1

friend class Aspose::Email::Clients::Graph::GraphClientV1
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::CreateAttachmentCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::CreateAttachmentCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::CreateTaskAttachmentCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::CreateTaskAttachmentCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::GetAttachmentCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::GetAttachmentCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::GetTaskAttachmentCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::GetTaskAttachmentCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::ListAttachmentsCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::ListAttachmentsCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::ListTaskAttachmentsCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::ListTaskAttachmentsCommand
friend

Member Data Documentation

◆ namedPropertyMappingStorage

System::SharedPtr<MapiNamedPropertyMappingStorage> Aspose::Email::Mapi::MapiAttachment::namedPropertyMappingStorage

The named property mapping storage.

@ Start
Sets the alarm to trigger off the start of the associated event.