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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Custom Form (Command Button) VBscript

Status
Not open for further replies.

Najemikon

Technical User
Mar 5, 2002
168
GB
Hi All,

I'm trying to create a custom form in Outlook with two simple buttons, but so far I'm stuck with a very unfriendly VBscript window! I'm happier in VBA and here it's just like typing it straight into notepad! I've no idea if it's right, testing seems impossible. So I thought I'd see if someone could point me in the right direction.

I'd like someone to be able to use the form to send an email to a fixed address. The recipient opens the email and has two buttons: "Approve" and "Reject".

"Approve" sends on the email to another pre-defined address.

"Reject" deletes the mail and possibly replies to the sender.

Well that's what I'd like anyway! But I can't get any response from the buttons (called btnApprove and btnDecline respectively).

How do I get code in the VBscript window to fire when the button is pressed?

Any ideas gratefully accepted, including "Don't use Outlook"!


Cheers,



Jon
 
I wasn't sure that I can. The VBA window seems to bear no relation to my custom form. From within the form itself I can only find the VBscript window.

Isn't there some restriction on VBA in Outlook, relating to the current session? I want to be able to send this form to various people as an Outlook template, so all the code is contained therein.

Sorry if I'm appearing thick! My experience is with Access where it's easy to bind a particular macro to a particular control. I'm pretty lost within Outlook.
 
Well it seems I was doing it correctly so far. After testing it further, I can get it to run. Just not where I need it.

The problem is, I only need the buttons and related code on the "Read Page", for the recipient. If I put them on the "Compose Page" they work for the person creating the email; the recipient can see the buttons, but they do nothing.

What am I doing wrong? Could it be some sort of security level?

But during testing, I am both the sender and the recipient, so I would have thought the security wasn't an issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top