0 Comments

If you want to create a JournalItem from C#, you van use the following code:

Code

// Get the default journal folder
MAPIFolder jounalFolder = Globals.ThisAddIn.Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderJournal);

// Create a new journal item JournalItem journalItem = jounalFolder.Items.Add(OlItemType.olJournalItem);

// Change some values of the new journal item journalItem.Subject = "This is a new JournalItem"; journalItem.Duration = 60; // 60 minutes journalItem.Start = DateTime.Now; journalItem.Categories = "ADA";
journalItem.Type = "Task"; // Default is Phone Call // Save the new journal item journalItem.Save();

Result

image


image

 

Note

The code can be used to create Mails, Task, Contacts, Appointments etc. Just change OlDefaultFolders.olFolderJournal and OlItemType.olJournalItem to the correct types.

One Reply to “How to create a JournalItem from a C# Outlook 2010 Add-in”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.