public static bool CanInitialize(Microsoft.Office.Tools.Outlook.FormRegionInitializingEventArgs e) { if (Properties.Settings.Default.MeetingsOn == false && Properties.Settings.Default.MessagesOn == false) { return(true); } if (e.OutlookItem is Outlook.MailItem) { if (!Properties.Settings.Default.MessagesOn) { return(true); } Outlook.MailItem mailItem = (Outlook.MailItem)e.OutlookItem; if (mailItem != null && mailItem.Sent) { return(false); } } else if (e.OutlookItem is Outlook.AppointmentItem) { if (!Properties.Settings.Default.MeetingsOn) { return(true); } Outlook.AppointmentItem appItem = (Outlook.AppointmentItem)e.OutlookItem; if (appItem != null && appItem.MeetingStatus != Outlook.OlMeetingStatus.olNonMeeting) { return(false); } } return(true); }
// Occurs before the form region is initialized. // To prevent the form region from appearing, set e.Cancel to true. // Use e.OutlookItem to get a reference to the current Outlook item. private void ContactInTouchSettingsFactory_FormRegionInitializing(object sender, Microsoft.Office.Tools.Outlook.FormRegionInitializingEventArgs e) { }
// Occurs before the form region is initialized. // To prevent the form region from appearing, set e.Cancel to true. // Use e.OutlookItem to get a reference to the current Outlook item. private void Approval_InitialFactory_FormRegionInitializing(object sender, Microsoft.Office.Tools.Outlook.FormRegionInitializingEventArgs e) { }