Sicos1977 / MsgKit

A .NET library to make MSG files without the need for Outlook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Appointment in Specific Folder/Set Folder within MsgKit

KeesBL opened this issue · comments

commented

I've created an appointment in MsgKit with Process.Start and I am trying to send it. Populating properties works well, and the message is well formatted when it opens in Outlook. However, I am unable to send it from outlook: I get a msgbox with the error message "Cannot send this meeting request."

Setting the folder is the only part of my previous code I was unable to replicate in MsgKit. Previously, I created the appointment item in a shared folder using the following code:

var recipient = mapi.CreateRecipient("norpy@contoso.com");
recipient.Resolve();
var folder = mapi.GetSharedDefaultFolder(recipient, OlDefaultFolders.olFolderCalendar);
var olAppointment = (AppointmentItem)folder.Items.Add(OlItemType.olAppointmentItem);

Is there a way to set the folder during the creation of the .msg file, or is that something that needs to be handled via Outlook?

Thanks in advance!

commented

To be honest I have no idea, normally a folder is not part of a msg file because the "folder" in Outlook is the place where you store an msg file. I have to look into the msg specifications to see if something like this is possible.