![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I created a form in Outlook 2003 with a command button. The code behind the
button is as follows: Sub cmdScheduleNotification_Click() dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate) tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime) Set myItem = Application.CreateItem(1) myItem.MeetingStatus = 1 myItem.Subject = "Issue Equipment" myItem.Location = "Equipment is for " & Item.UserProperties("For") myItem.Start = CDate(dte & " " & tme) myItem.Duration = 0 'was 90 myItem.ReminderMinutesBeforeStart = 30 '1 day reminder = 1440, 1 week = 10080 myItem.BusyStatus = Free Set myRequiredAttendee = myItem.Recipients.Add ("LDM") myRequiredAttendee.Type = 1 Set myOptionalAttendee = myItem.Recipients.Add ("JDE") myOptionalAttendee.Type = 2 myItem.Send msgbox "Notification has been Scheduled" End Sub This code works fine, however, instead of running the code by pressing the command button, I'd rather the code run once the user presses "SEND" (after of course they complete the form). Can someone help me with this. Thanks in advance! LDMueller |
#2
|
|||
|
|||
![]()
In the form code window select Script, Event Handler. Add the Send event to
the code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "LDMueller" wrote in message ... I created a form in Outlook 2003 with a command button. The code behind the button is as follows: Sub cmdScheduleNotification_Click() dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate) tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime) Set myItem = Application.CreateItem(1) myItem.MeetingStatus = 1 myItem.Subject = "Issue Equipment" myItem.Location = "Equipment is for " & Item.UserProperties("For") myItem.Start = CDate(dte & " " & tme) myItem.Duration = 0 'was 90 myItem.ReminderMinutesBeforeStart = 30 '1 day reminder = 1440, 1 week = 10080 myItem.BusyStatus = Free Set myRequiredAttendee = myItem.Recipients.Add ("LDM") myRequiredAttendee.Type = 1 Set myOptionalAttendee = myItem.Recipients.Add ("JDE") myOptionalAttendee.Type = 2 myItem.Send msgbox "Notification has been Scheduled" End Sub This code works fine, however, instead of running the code by pressing the command button, I'd rather the code run once the user presses "SEND" (after of course they complete the form). Can someone help me with this. Thanks in advance! LDMueller |
#3
|
|||
|
|||
![]()
That was exactly what I needed. I sincerely thank you!
LDMueller "Ken Slovak - [MVP - Outlook]" wrote: In the form code window select Script, Event Handler. Add the Send event to the code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "LDMueller" wrote in message ... I created a form in Outlook 2003 with a command button. The code behind the button is as follows: Sub cmdScheduleNotification_Click() dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate) tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime) Set myItem = Application.CreateItem(1) myItem.MeetingStatus = 1 myItem.Subject = "Issue Equipment" myItem.Location = "Equipment is for " & Item.UserProperties("For") myItem.Start = CDate(dte & " " & tme) myItem.Duration = 0 'was 90 myItem.ReminderMinutesBeforeStart = 30 '1 day reminder = 1440, 1 week = 10080 myItem.BusyStatus = Free Set myRequiredAttendee = myItem.Recipients.Add ("LDM") myRequiredAttendee.Type = 1 Set myOptionalAttendee = myItem.Recipients.Add ("JDE") myOptionalAttendee.Type = 2 myItem.Send msgbox "Notification has been Scheduled" End Sub This code works fine, however, instead of running the code by pressing the command button, I'd rather the code run once the user presses "SEND" (after of course they complete the form). Can someone help me with this. Thanks in advance! LDMueller |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Open Appointment form from User Form code and add the attemdee ite | masani paresh[_2_] | Outlook - Using Forms | 2 | February 11th 09 11:59 AM |
Custom Form Code | Joel Allen | Outlook and VBA | 5 | August 15th 07 03:20 AM |
VBA Code on Message form to take me to Appointment form | LDMueller | Outlook and VBA | 10 | June 14th 07 03:10 PM |
How to replace Default Contact form with Customised conact form using VBScript code | Satish Boddapati | Outlook - Using Contacts | 0 | October 12th 06 08:20 AM |
How to replace Default Contact form with Customised conact form using VBScript code | Satish Boddapati | Outlook - Installation | 0 | October 12th 06 08:19 AM |