MapiNoteBuilder Class

A sticky note (IPM.StickyNote, [MS-OXONOTE]) to add to a folder of a PstWriter or to save as an .msg file.

public sealed class MapiNoteBuilder : MapiMessageBuilder

Example

using (var writer = PstWriter.Create(stream, leaveOpen: true))
{
    var notes = writer.RootFolder.CreateFolder("Notes", "IPF.StickyNote");
    notes.AddItem(new MapiNoteBuilder
    {
        Text = "Call Bob\r\nAbout the quarterly report",
        Color = MapiNoteColor.Green,
        Width = 200,
        Height = 166,
    });
}

using var file = PstFile.Open(stream);
var note = Assert.IsType<MapiNote>(file.GetFolder("Notes")!.EnumerateItems().Single());
Assert.Equal("Call Bob", note.Subject);
Assert.Equal("Call Bob\r\nAbout the quarterly report", note.Body);
Assert.Equal(MapiNoteColor.Green, note.Color);
Assert.Equal(200, note.Width);
Inheritance
MapiMessageBuilder MapiNoteBuilder

Constructors

NameDescription
MapiNoteBuilder()Initializes a new instance of the MapiNoteBuilder class.

MapiNoteBuilder()

MapiNoteBuilder.cs

Initializes a new instance of the MapiNoteBuilder class.

public MapiNoteBuilder()

Properties

NameDescription
ColorGets or sets the background color of the note.
HeightGets or sets the height of the window of the note, in pixels.
LeftGets or sets the distance, in pixels, from the left edge of the screen to the window of the note.
TextGets or sets the text of the note. It sets the subject too: Outlook shows the first line of the text as the subject ([MS-OXONOTE] 2.2.1.4).
TopGets or sets the distance, in pixels, from the top edge of the screen to the window of the note.
WidthGets or sets the width of the window of the note, in pixels.

Gets or sets the background color of the note.

public MapiNoteColor Color { get; set; }

Property value

MapiNoteColor

Gets or sets the height of the window of the note, in pixels.

public int? Height { get; set; }

Property value

int?

Gets or sets the distance, in pixels, from the left edge of the screen to the window of the note.

public int? Left { get; set; }

Property value

int?

Gets or sets the text of the note. It sets the subject too: Outlook shows the first line of the text as the subject ([MS-OXONOTE] 2.2.1.4).

public string? Text { get; set; }

Property value

string?

Gets or sets the distance, in pixels, from the top edge of the screen to the window of the note.

public int? Top { get; set; }

Property value

int?

Gets or sets the width of the window of the note, in pixels.

public int? Width { get; set; }

Property value

int?