Aspose::Email::Mapi::Msg::MessageObject Class Referencefinal

Represents an Outlook message object. Evaluation limits: only 1 attachment and 1 recipient are read when message is being loaded, watermark will be added when the message is being saved. More...

Inherits Aspose::Email::Mapi::Msg::IMessageObjectPropertyContainer.

Public Member Functions

System::SharedPtr< MessageObjectPropertiesCollectionget_Properties () override
 Gets the properties of the MessageObject. More...
 
int32_t get_Codepage ()
 Gets the codepage used to encode/decode string properties in case MapiType::PT_STRING8 type for them is used. More...
 
System::SharedPtr< MessageObjectRecipientsCollectionget_Recipients () const
 Gets the recipients of the MessageObject. More...
 
System::SharedPtr< MessageObjectAttachmentsCollectionget_Attachments () const
 Gets the attachments of the MessageObject. More...
 
 MessageObject (System::SharedPtr< MessageObjectPropertiesCollection > properties, System::SharedPtr< MessageObjectRecipientsCollection > recipients, System::SharedPtr< MessageObjectAttachmentsCollection > attachments)
 Initializes a new instance of the MessageObject class, used internally for embedded messages. More...
 
 MessageObject (System::SharedPtr< System::IO::Stream > stream, MessageObjectLoadFormat loadFormat)
 Initializes a new instance of the MessageObject class. More...
 
 MessageObject (System::String fileName, MessageObjectLoadFormat loadFormat)
 Initializes a new instance of the MessageObject class. More...
 
void Save (System::String fileName, MessageObjectSaveFormat format)
 Saves the current message object to the specified file. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream, MessageObjectSaveFormat format)
 Saves the current message object to the specified stream. More...
 
int32_t GetIdForNamedProperty ()
 Gets the id to be used for named property, named properties are special properties and should have their ids in range [0x8000,0xfffe] aligned starting from 0x8000 sequentally. Use this method to find the available id cause it could be hard to calculate it yourself. More...
 

Protected Member Functions

virtual ~MessageObject ()
 

Friends

class Aspose::Email::Mapi::Msg::CFB::MessageObjectCFBReader
 
class Aspose::Email::Storage::Pst::PstDoer
 

Detailed Description

Represents an Outlook message object. Evaluation limits: only 1 attachment and 1 recipient are read when message is being loaded, watermark will be added when the message is being saved.

Constructor & Destructor Documentation

◆ MessageObject() [1/3]

Aspose::Email::Mapi::Msg::MessageObject::MessageObject ( System::SharedPtr< MessageObjectPropertiesCollection properties,
System::SharedPtr< MessageObjectRecipientsCollection recipients,
System::SharedPtr< MessageObjectAttachmentsCollection attachments 
)

Initializes a new instance of the MessageObject class, used internally for embedded messages.

Parameters
propertiesThe properties list.
recipientsThe recipients list.
attachmentsThe attachments list.

◆ MessageObject() [2/3]

Aspose::Email::Mapi::Msg::MessageObject::MessageObject ( System::SharedPtr< System::IO::Stream >  stream,
MessageObjectLoadFormat  loadFormat 
)

Initializes a new instance of the MessageObject class.

Parameters
streamThe stream to initialize this object from.
loadFormatThe source format message object is stored with.
Exceptions
ArgumentNullExceptionIf given stream is null.
ArgumentOutOfRangeExceptionIf specified loadFormat is not supported.

◆ MessageObject() [3/3]

Aspose::Email::Mapi::Msg::MessageObject::MessageObject ( System::String  fileName,
MessageObjectLoadFormat  loadFormat 
)

Initializes a new instance of the MessageObject class.

Parameters
fileNameName of the file to read from.
loadFormatThe source format message object is stored with.
Exceptions
ArgumentOutOfRangeExceptionIf specified loadFormat is not supported.

In addition same set of exceptions could be thrown as for the File::Open(string,System::IO::FileMode) call.

◆ ~MessageObject()

virtual Aspose::Email::Mapi::Msg::MessageObject::~MessageObject ( )
protectedvirtual

Member Function Documentation

◆ get_Attachments()

System::SharedPtr<MessageObjectAttachmentsCollection> Aspose::Email::Mapi::Msg::MessageObject::get_Attachments ( ) const

Gets the attachments of the MessageObject.

The attachments.

◆ get_Codepage()

int32_t Aspose::Email::Mapi::Msg::MessageObject::get_Codepage ( )

Gets the codepage used to encode/decode string properties in case MapiType::PT_STRING8 type for them is used.

The codepage.

◆ get_Properties()

System::SharedPtr<MessageObjectPropertiesCollection> Aspose::Email::Mapi::Msg::MessageObject::get_Properties ( )
overridevirtual

Gets the properties of the MessageObject.

The properties.

Implements Aspose::Email::Mapi::Msg::IMessageObjectPropertyContainer.

◆ get_Recipients()

System::SharedPtr<MessageObjectRecipientsCollection> Aspose::Email::Mapi::Msg::MessageObject::get_Recipients ( ) const

Gets the recipients of the MessageObject.

The recipients.

◆ GetIdForNamedProperty()

int32_t Aspose::Email::Mapi::Msg::MessageObject::GetIdForNamedProperty ( )

Gets the id to be used for named property, named properties are special properties and should have their ids in range [0x8000,0xfffe] aligned starting from 0x8000 sequentally. Use this method to find the available id cause it could be hard to calculate it yourself.

Returns
Available id for the named property.

◆ Save() [1/2]

void Aspose::Email::Mapi::Msg::MessageObject::Save ( System::SharedPtr< System::IO::Stream >  stream,
MessageObjectSaveFormat  format 
)

Saves the current message object to the specified stream.

Parameters
streamThe stream to write to.
formatThe format of the output data.
Exceptions
ArgumentNullExceptionIf stream is null.
ArgumentOutOfRangeExceptionIf format value is not valid.

◆ Save() [2/2]

void Aspose::Email::Mapi::Msg::MessageObject::Save ( System::String  fileName,
MessageObjectSaveFormat  format 
)

Saves the current message object to the specified file.

Parameters
fileNameName of the file.
formatThe format of the output data.
Exceptions
ArgumentOutOfRangeExceptionIf format value is not valid.

In addition same set of exceptions could be thrown as for the File::OpenWrite call.

Friends And Related Function Documentation

◆ Aspose::Email::Mapi::Msg::CFB::MessageObjectCFBReader

friend class Aspose::Email::Mapi::Msg::CFB::MessageObjectCFBReader
friend

◆ Aspose::Email::Storage::Pst::PstDoer

friend class Aspose::Email::Storage::Pst::PstDoer
friend