Ejemplo n.º 1
0
 public static void Run()
 {
     // ExStart:ReadMapiNote
     // The path to the File directory.
     string      dataDir = RunExamples.GetDataDir_Outlook();
     MapiMessage note    = MapiMessage.FromFile(dataDir + "MapiNote.msg");
     MapiNote    note2   = (MapiNote)note.ToMapiMessageItem();
     // ExEnd:ReadMapiNote
 }
 public static void Run()
 {
     // ExStart:CreatAndSaveAnOutlookNote
     // The path to the File directory.
     string dataDir = RunExamples.GetDataDir_Outlook();
     // Create MapiNote and set Properties 
     MapiNote note3 = new MapiNote();
     note3.Subject = "Blue color note";
     note3.Body = "This is a blue color note";
     note3.Color = NoteColor.Blue;
     note3.Height = 500;
     note3.Width = 500;
     note3.Save(dataDir + "MapiNote_out.msg", NoteSaveFormat.Msg);
     // ExEnd:CreatAndSaveAnOutlookNote
 }
Ejemplo n.º 3
0
        public static void Run()
        {
            // ExStart:CreatAndSaveAnOutlookNote
            // The path to the File directory.
            string dataDir = RunExamples.GetDataDir_Outlook();
            // Create MapiNote and set Properties
            MapiNote note3 = new MapiNote();

            note3.Subject = "Blue color note";
            note3.Body    = "This is a blue color note";
            note3.Color   = NoteColor.Blue;
            note3.Height  = 500;
            note3.Width   = 500;
            note3.Save(dataDir + "MapiNote_out.msg", NoteSaveFormat.Msg);
            // ExEnd:CreatAndSaveAnOutlookNote
        }
Ejemplo n.º 4
0
        public static void Run()
        {
            // ExStart:AddMapiNoteToPST
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Outlook();

            MapiMessage mess = MapiMessage.FromFile(dataDir + "Note.msg");

            // Create three Notes
            MapiNote note1 = (MapiNote)mess.ToMapiMessageItem();

            note1.Subject = "Yellow color note";
            note1.Body    = "This is a yellow color note";

            MapiNote note2 = (MapiNote)mess.ToMapiMessageItem();

            note2.Subject = "Pink color note";
            note2.Body    = "This is a pink color note";
            note2.Color   = NoteColor.Pink;

            MapiNote note3 = (MapiNote)mess.ToMapiMessageItem();

            note2.Subject = "Blue color note";
            note2.Body    = "This is a blue color note";
            note2.Color   = NoteColor.Blue;
            note3.Height  = 500;
            note3.Width   = 500;

            string path = dataDir + "AddMapiNoteToPST_out.pst";

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            using (PersonalStorage personalStorage = PersonalStorage.Create(dataDir + "AddMapiNoteToPST_out.pst", FileFormatVersion.Unicode))
            {
                FolderInfo notesFolder = personalStorage.CreatePredefinedFolder("Notes", StandardIpmFolder.Notes);
                notesFolder.AddMapiMessageItem(note1);
                notesFolder.AddMapiMessageItem(note2);
                notesFolder.AddMapiMessageItem(note3);
            }
            // ExEnd:AddMapiNoteToPST
        }
Ejemplo n.º 5
0
        public static void Run()
        {
            // The path to the File directory.
            // ExStart:CreateNewMapiCalendarAndAddToCalendarSubfolder
            string      dataDir = RunExamples.GetDataDir_Outlook();
            MapiMessage message = MapiMessage.FromFile(dataDir + "Note.msg");

            // Note #1
            MapiNote note1 = (MapiNote)message.ToMapiMessageItem();

            note1.Subject = "Yellow color note";
            note1.Body    = "This is a yellow color note";

            // Note #2
            MapiNote note2 = (MapiNote)message.ToMapiMessageItem();

            note2.Subject = "Pink color note";
            note2.Body    = "This is a pink color note";
            note2.Color   = NoteColor.Pink;

            // Note #3
            MapiNote note3 = (MapiNote)message.ToMapiMessageItem();

            note2.Subject = "Blue color note";
            note2.Body    = "This is a blue color note";
            note2.Color   = NoteColor.Blue;
            note3.Height  = 500;
            note3.Width   = 500;

            if (File.Exists(dataDir + "SampleNote_out.pst"))
            {
                File.Delete(dataDir + "SampleNote_out.pst");
            }

            using (PersonalStorage pst = PersonalStorage.Create(dataDir + "SampleNote_out.pst", FileFormatVersion.Unicode))
            {
                FolderInfo notesFolder = pst.CreatePredefinedFolder("Notes", StandardIpmFolder.Notes);
                notesFolder.AddMapiMessageItem(note1);
                notesFolder.AddMapiMessageItem(note2);
                notesFolder.AddMapiMessageItem(note3);
            }
            // ExEnd:CreateNewMapiCalendarAndAddToCalendarSubfolder
        }