I am currently trying to put together a form for co-workers to request time off using Microsoft Outlook. The initial form is set up so the member has to place his supervisor’s email in the “To” line, and enter the following information: start/stop date, address, own email address, and a few other items. Once the member sends the email the supervisor receives a copy. The supervisor’s copy will have four options to choose from: “approve and forward”, “reject and forward”, “final approval”, and final rejection”. I am curious if there is a way to add a CC recipient once the supervisor selects “final approval”, or “final rejection”? The CC field would need to stay blank at all other times. That and is there a way to have the email show the current date and time? Currently it only posts the time in which the initial request was submitted. (in the “Sent:” line). Any help is greatly appreciated.
Thank you in advance,
Chris
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Function Item_Send()
MyValue = Item.UserProperties("Have Replies Sent To")
My2Value = Item.UserProperties("Name")
My3Value = Item.UserProperties("frmBeginLeave")
My4Value = Item.UserProperties("frmEndLeave")
My5Value = Item.UserProperties("Date")
My6Value = Item.UserProperties("EmployeeID")
My7Value = Item.UserProperties("LeaveAddress")
My8Value = Item.UserProperties("Request")
My9Value = Item.UserProperties("RequestNotes")
My12Value = Item.UserProperties("LeaveToBeCharged")
date1 = Instr(4,My3Value,"/")
datea1 = Mid(My3Value,1,date1+4)
date2 = Instr(4,My4Value,"/")
dateb2 = Mid(My4Value,1,date2+4)
My10Value = "Requestor: " & MyValue & VbLf & "Employee ID: " & My6Value & VbLf & "Begin Date: " & datea1 & VbLf & "End Date: " & dateb2 & VbLf & "Leave To Be Charged: " & My12Value & VbLf & "Leave Address: " & My7Value & VbLf & VbLf & My9Value & VbLf & "*** *** *** *** ***" & VbLf & VbLf
My11Value = MyValue
Item.UserProperties("Request").Value = My10Value
Item.UserProperties("Have Replies Sent To").Value = My11Value
Item.Body = My10Value
End Function
Function Item_Open()
Item.Cc = ""
End Function
-----Original Message-----
From:
Sent: Friday, February 06, 2009 10:01 AM
To:
Subject: LEAVE REQUEST 2/6/2009 2/6/2009
Requestor:
Employee ID:
Begin Date: 2/6/2009
End Date: 2/6/2009
Leave To Be Charged: 1
Leave Address: test test
*** *** *** *** ***
Comments:
*** *** *** *** ***
Thank you in advance,
Chris
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Function Item_Send()
MyValue = Item.UserProperties("Have Replies Sent To")
My2Value = Item.UserProperties("Name")
My3Value = Item.UserProperties("frmBeginLeave")
My4Value = Item.UserProperties("frmEndLeave")
My5Value = Item.UserProperties("Date")
My6Value = Item.UserProperties("EmployeeID")
My7Value = Item.UserProperties("LeaveAddress")
My8Value = Item.UserProperties("Request")
My9Value = Item.UserProperties("RequestNotes")
My12Value = Item.UserProperties("LeaveToBeCharged")
date1 = Instr(4,My3Value,"/")
datea1 = Mid(My3Value,1,date1+4)
date2 = Instr(4,My4Value,"/")
dateb2 = Mid(My4Value,1,date2+4)
My10Value = "Requestor: " & MyValue & VbLf & "Employee ID: " & My6Value & VbLf & "Begin Date: " & datea1 & VbLf & "End Date: " & dateb2 & VbLf & "Leave To Be Charged: " & My12Value & VbLf & "Leave Address: " & My7Value & VbLf & VbLf & My9Value & VbLf & "*** *** *** *** ***" & VbLf & VbLf
My11Value = MyValue
Item.UserProperties("Request").Value = My10Value
Item.UserProperties("Have Replies Sent To").Value = My11Value
Item.Body = My10Value
End Function
Function Item_Open()
Item.Cc = ""
End Function
-----Original Message-----
From:
Sent: Friday, February 06, 2009 10:01 AM
To:
Subject: LEAVE REQUEST 2/6/2009 2/6/2009
Requestor:
Employee ID:
Begin Date: 2/6/2009
End Date: 2/6/2009
Leave To Be Charged: 1
Leave Address: test test
*** *** *** *** ***
Comments:
*** *** *** *** ***