Thread: Voting button
View Single Post
  #2  
Old April 6th 06, 06:11 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Voting button

txtHolStart sounds like the name of a control, not a custom property. They use different syntaxes; see http://www.outlookcode.com/d/propsyntax.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"stanhope4" wrote in message oups.com...
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