Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook 2007 Form: Executing a Custom Action

Status
Not open for further replies.

Mihyun

IS-IT--Management
Jan 20, 2009
2
Hello,

I believe what I am trying to accomplish is fairly simple. I made a new Custom Action for my Outlook form, and I am trying to execute it using a Command Button (as opposed to having the user find it on the ribbon).

When the Command Button is clicked, a message box appears with the option to choose Yes or No. Upon choosing Yes, I would like the form to execute the custom action I made named "Approve".

I'm finding that the biggest problem I'm having with learning VBScript is not knowing the proper syntax. Here's what the code looks like so far:

Sub ApproveButton_Click()
MsgBox "Are you sure you want to approve this request?", 4
If vbYes = 6 Then
Set MyAction = Application.ActiveInspector.CurrentItem.Actions("Approve") 'This line is probably completely wrong
MyAction.Execute 'Also wrong, most likely
End If
End Sub




Just to clarify, this Custom Action was NOT made using VBScript. It was made in the Actions tab of the form.

Thank you for your time.
 
Anyway, replace this:
MsgBox "Are you sure you want to approve this request?", 4
If vbYes = 6 Then

with this:
If MsgBox("Are you sure you want to approve this request?", 4) = 6 Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the tip, PHV. It doesn't solve my problem, but it's always good to clean up the messy scripting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top