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

Hi,

I currently have two voting buttons setup 'approve' and 'deny', i am
trying to code (a bit of a novice) so that when i click the apprioriate
button it opens a new email containing relevent information from a
previous form.

below is the code:

select case Action.Name
case "Approval"
Set Newitem = Application.CreateItem(olMailItem)
item.userproperties.find("Approve") = true
Actions.Item("Approve").Enabled = False
Actions.Item("Deny").Enabled = False
NewItem.Body = "Your request from" &
(item.userproperties.find("txtHolStart")) &
" to " & (item.userproperties.find("txtHolEnd")) & "for
" & (item.userproperties.find("totaldays"))& " days leave has been
approved."
case "Deny"
item.userproperties.find("Denied") = true
Actions.Item("Approve").Enabled = False
Actions.Item("Deny").Enabled = False
NewItem.Body = "Your request from " &
(item.userproperties.find("txtHolStart")) &
" to " & (item.userproperties.find("txtHolEnd")) & "for
" & (item.userproperties.find("Totaldays"))& " days leave has been
denied."
end select

item.close(0)

Item_CustomAction = true

not sure what im doing wrong but i keep getting a 'syntax error' on the
line :
NewItem.Body = "Your request from" &
(item.userproperties.find("txtHolStart")) &

also i would like to add reciepients into this email so any help with
that would be much appricated!

Thanks in advance.

Ads