Thread: Voting button
View Single Post
  #1  
Old April 10th 06, 01:51 PM posted to microsoft.public.outlook.program_vba
stanhope4
external usenet poster
 
Posts: 5
Default Voting button

Function Item_CustomAction(ByVal Action, ByVal NewItem)

select case Action.Name
case "Approve"
Set Newitem = Application.CreateItem(olMailItem)
item.userproperties.find("Approve") = true
Actions.Item("Approve").Enabled = True
Actions.Item("Deny").Enabled = True
Newitem.subject = "Holiday Request Approved"
NewItem.Body = "Your request from"
&(item.userproperties.find("HolidayStart")) &
" to " & (item.userproperties.find("HolidayEnd")) & "for
" & (item.userproperties.find("totaldays"))& " days leave has been
approved."

case "Deny"
item.userproperties.find("Deny") = true
Actions.Item("Approve").Enabled = True
Actions.Item("Deny").Enabled = True
Newitem.subject "Holiday Request Denied"
NewItem.Body = "Your request from " &
(item.userproperties.find("HolidayStart")) &
" to " & (item.userproperties.find("HolidayEnd")) & "for
" & (item.userproperties.find("Totaldays"))& " days leave has been
denied."
end select

item.close(0)

Item_CustomAction = true

end function

line " NewItem.Body = "Your request from"
&(item.userproperties.find("HolidayStart")) &" is coming up with error
'syntax error' when i run the form.

have 2 buttons approve and deny and i want to create a new email when
relevent button is pressed to create a new email with the relevent data
in the email body.

Ads