Class MapiNote
Contents
[
Hide
]MapiNote class
Represents a MAPI note (“sticky note”) item.
public sealed class MapiNote : MapiMessageItemBase
Constructors
| Name | Description |
|---|---|
| MapiNote() | Initializes a new instance of the MapiNote class. |
| MapiNote(string, string) | Initializes a new instance of the MapiNote class with a subject and a body. |
Properties
| Name | Description |
|---|---|
| Attachments { get; } | Gets the attachments of the item. |
| Billing { get; set; } | Gets or sets the billing information of the item. |
| Body { get; set; } | Gets or sets the plain-text body of the item. |
| BodyHtml { get; } | Gets the body of the item as HTML, converted from BodyRtf; an empty string when there is no RTF body. |
| BodyRtf { get; set; } | Gets or sets the body of the item in RTF format. |
| BodyType { get; } | Gets the format of the body: plain text, HTML or RTF. |
| Categories { get; set; } | Gets or sets the categories of the item. |
| virtual CodePage { get; } | Gets the code page of the ANSI strings of the object. |
| Color { get; set; } | Gets or sets the background color of the note. |
| Companies { get; set; } | Gets or sets the names of the companies associated with the item. |
| CreationDate { get; set; } | Gets or sets the date and time the note was created. |
| Height { get; set; } | Gets or sets the height of the note window, in pixels. |
| virtual ItemId { get; } | Gets the identifier of the item on the mail server, for items obtained from a server; null otherwise. |
| MessageClass { get; set; } | Gets or sets the message class of the item, such as IPM.Note for an e-mail message. The class determines the type of the item. |
| Mileage { get; set; } | Gets or sets the mileage information of the item. |
| NamedProperties { get; } | Gets the named properties of the item. |
| NamedPropertyMapping { get; } | Gets the mapping between the named properties and the tags they are stored under. |
| virtual Properties { get; } | Gets all properties of the object. |
| PropertyStream { get; } | Gets the property stream of the item. |
| Recipients { get; set; } | Gets or sets the recipients of the item. |
| Sensitivity { get; set; } | Gets or sets the sensitivity of the item: normal, personal, private or confidential. |
| Subject { get; set; } | Gets or sets the subject of the message. |
| SubjectPrefix { get; } | Gets the prefix of the subject, such as RE: or FW: . |
| SubStorages { get; } | Gets the sub-storages of the item. |
| SupportedType { get; } | Gets the type of the item, as determined by its message class. |
| Width { get; set; } | Gets or sets the width of the note window, in pixels. |
| XPosition { get; set; } | Gets or sets the distance of the note window from the left edge of the screen, in pixels. |
| YPosition { get; set; } | Gets or sets the distance of the note window from the top edge of the screen, in pixels. |
Methods
| Name | Description |
|---|---|
| static Load(Stream) | Loads a MapiNote from the specified stream. |
| static Load(string) | Loads a MapiNote from the specified file. |
| virtual Dispose() | Releases the resources used by the item. |
| override GetProperty(PropertyDescriptor) | Gets a MAPI property of the item by its descriptor. |
| GetPropertyBoolean(long) | Gets the value of a property as a Boolean. |
| GetPropertyBytes(long) | Gets the value of a property as bytes. |
| GetPropertyDateTime(long) | Gets the value of a property as a date and time. |
| GetPropertyInt32(long) | Gets the value of a property as a 32-bit integer. |
| GetPropertyLong(long) | Gets the value of a property as a 64-bit integer. |
| GetPropertyShort(long) | Gets the value of a property as a 16-bit integer. |
| GetPropertyString(long) | Gets the value of a property as a string. |
| GetPropertyString(long, int) | Gets the value of a property as a string, decoding an ANSI string with the specified code page. |
| GetUnderlyingMessage() | Retrieves the underlying MapiMessage object. |
| IsStoreUnicodeOk() | Determines whether the string properties of the object are stored in Unicode. |
| RemoveProperty(long) | Removes a property from the item, including its named-property mapping. |
| Save(Stream) | Saves this MapiNote to the given stream. |
| Save(string) | Saves this MapiNote to the given file. |
| Save(Stream, NoteSaveFormat) | Saves the note to a stream in the specified format. Only MSG is supported. |
| Save(string, NoteSaveFormat) | Saves the note to a file in the specified format. Only MSG is supported. |
| SaveAsync(Stream, NoteSaveFormat, CancellationToken) | Saves this MapiNote to the given stream using specified format asynchronously. The supported save format is MSG. |
| SaveAsync(string, NoteSaveFormat, CancellationToken) | Saves this MapiNote into file using specified format asynchronously. The supported save format is MSG. |
| virtual SetBodyContent(string, BodyContentType) | Sets the body of the item in the specified format. |
| virtual SetBodyContent(string, BodyContentType, bool) | Sets the body of the item in the specified format, optionally compressing it. |
| SetBodyRtf(string, bool) | Sets the body of the item in RTF format, optionally compressing it. |
| SetMessageFlags(MapiMessageFlags) | Sets the flags of the message, such as read or unsent. |
| virtual SetProperty(MapiProperty) | Adds the property, or replaces the property with the same tag. |
| override SetProperty(PropertyDescriptor, object) | Sets the value of a MAPI property of the item. |
| TryGetPropertyData(long) | Gets the value of a property as bytes. |
| TryGetPropertyDateTime(long, ref DateTime) | Gets the value of a property as a date and time, if the property exists. |
| TryGetPropertyInt32(long, ref int) | Gets the value of a property as a 32-bit integer, if the property exists. |
| TryGetPropertyLong(long, ref long) | Gets the value of a property as a 64-bit integer, if the property exists. |
| TryGetPropertyString(long) | Gets the value of a property as a string. |
| TryGetPropertyString(long, int) | Gets the value of a property as a string, decoding an ANSI string with the specified code page. |
| TryGetPropertyString(long, ref string) | Gets the value of a property as a string, if the property exists. |
| TryGetPropertyString(long, ref string, int) | Gets the value of a property as a string, if the property exists, decoding an ANSI string with the specified code page. |
| static LoadAsync(Stream, CancellationToken) | Loads a MapiNote from the specified stream asynchronously. |
| static LoadAsync(string, CancellationToken) | Loads a MapiNote from the specified file asynchronously. |
Remarks
This class serves as a wrapper for MapiMessage to simplify the process of handling note information from MAPI properties. It provides a more intuitive interface for accessing and manipulating note data within the MAPI message.
Examples
The following example demonstrates how to get a MapiNote object from a MapiMessage.
[C#]
var msg = MapiMessage.Load("note.msg");
// Check if the loaded message is a supported note type
if (msg.SupportedType == MapiItemType.Note)
{
// Convert the MAPI message to a MapiNote object
var mapiNote = (MapiNote)msg.ToMapiMessageItem();
// Display some note info
Console.WriteLine(mapiNote.Color);
Console.WriteLine(mapiNote.Body);
}
[Visual Basic]
Dim msg = MapiMessage.Load("note.msg")
' Check if the loaded message is a supported note type
If msg.SupportedType = MapiItemType.Note Then
' Convert the MAPI message to a MapiNote object
Dim mapiNote = DirectCast(msg.ToMapiMessageItem(), MapiNote)
' Display some note info
Console.WriteLine(mapiNote.Color)
Console.WriteLine(mapiNote.Body)
End If
See Also
- class MapiMessageItemBase
- namespace Aspose.Email.Mapi
- assembly Aspose.Email