Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / December 2003

Tip: Looking for answers? Try searching our database.

Launching form from commandbarbutton

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicolai Gr?dum - 22 Dec 2003 12:52 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.