microsoft outlook 2010 - Add a button to an e-mail which runs a macro when clicked

28
2013-08
  • Growler

    I'd like to send a friend an e-mail that has a clickable button in the message body... The button will run a macro.

    I know you can do macros on your side of things, such as:

    Private Sub Application_ItemLoad(ByVal Item As Object)
        MsgBox "Hey Look a Macro!"
    End Sub
    

    Which will run a macro when I load a new e-mail.

    I'd like to attach this macro to run when the button in the e-mail I sent is clicked on. Btw, I don't mind if the receiving user receives warnings about the macro, just so long as they can execute it via a button

    I'd like to know:

    • Is that possible?
    • How do I do it?

    Thanks!


    Edit: All I see are ways to run a macro on my side, not send an executable macro to someone else

    enter image description here

  • Answers
  • Geoff

    You've tagged your question with Outlook, so one option open to you is to use a custom form. Distribution of that form is easier if you're in the same Exchange organization, although it's still possible if not. There's an excellent writeup on this page, including creating the form and publishing it to other users.

    Note that this option assumes that your sending the code is not a one-off occurrence, but rather something that you do on a regular basis.

    You don't say much about your end goal, but if you're just trying to give your friend a button to press, other strategies could include using the (free) Visual Studio Express to create a small VB EXE, and send it to your friend (in a zipped format to avoid the Outlook security warning) - or, just send them a dropbox link to the EXE itself.


  • Related Question

    windows 7 - Automate mouse button click with script or macro
  • anon

    I'm searching for a script or macro program which pushes the 4th or 5th mouse button every 5 seconds.

    This script or macro program is for a friend who uses Windows 7 on an Asus notebook. I cannot try this because I use opensuse 11.0. I have googled but haven't found anything.


  • Related Answers
  • Dennis Williamson

    You should be able to write a script to do that using AutoHotkey or AutoIt.

  • DMeister

    Is it for a website? Then try the iMacros for Firefox addon.