I currently have this code on my button_click event (COM-addin, created for
Outlook 2000 and up)
(MyTrustedOL is the Application from IDTExtensibility2_OnConnection)
Dim myFolder As MAPIFolder
Set myFolder = MyTrustedOL.Session.GetDefaultFolder(olFolderCalendar)
Dim myItem As AppointmentItem
Set myItem = myFolder.Items.Add("IPM.Appointment.MyCustomForm")
myItem.MeetingStatus = olMeeting
myItem.Display
I have two problems:
1. Setting myItem.MeetingStatus = olMeeting changes the myItem.Saved
property, which is read-only. This will cause the user to get prompted to
save changes, even when he hasn't changed anything. Are there any
workarounds for this?
I do not want to change the default display mode of the custom form to
meeting (by changing the form in design mode and publishing it). I only want
it changed on the fly when launched from my toolbar button.
2. When you click the standard new meeting/appointment Outlook buttons, the
start time and end time is set from the selected timespan in my calendar (if
selected). Is there a method to get the selected start time/end time in the
onclick event so I can provide the same behavior for my button? With the
code above, I get starttime set to the next half hour and endtime half an
hour later.
Nicolai Gr?dum
Ken Slovak - [MVP - Outlook] - 22 Dec 2003 14:18 GMT
The selected time is not available to you. Save the item in your code
to avoid a UI prompt to save.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> I currently have this code on my button_click event (COM-addin, created for
> Outlook 2000 and up)
[quoted text clipped - 25 lines]
>
> Nicolai Gr?dum
Nicolai Gr?dum - 22 Dec 2003 14:27 GMT
If I try to save, I get the "no subject has been entered" warning. I do not
want to hard-code a subject.
> The selected time is not available to you. Save the item in your code
> to avoid a UI prompt to save.
[quoted text clipped - 47 lines]
> >
> > Nicolai Gr?dum
Ken Slovak - [MVP - Outlook] - 22 Dec 2003 14:35 GMT
You can't have it both ways. If you don't save the user will get that
prompt. You can hard code a space as the subject if you want.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> If I try to save, I get the "no subject has been entered" warning. I do not
> want to hard-code a subject.