Cannot run create macros within Outlook 2007

Not open for further replies.


I have a user who is able to record macros within Word and run them. However, when she attempts to run the macro within an open Outlook message (by going to the "Macros" button that is within the Developer tab of an open message window, these same macros do not initially appear despite the fact that Word is the exclusive editor for Outlook 2007. To the best of my understanding according to Microsoft, is is not possible to record macros within Outlook (if you can, I do not see where or how). It is possble to make the macro appear within Outlook if you were to copy the subroutine pertaining to the macro from Word's Visual Basic editor to Outlook's Visual Basic editor, but when you then actually attempt to run the macro within Outlook, you get the following error message

----------------------------- Runtime Error '424'
Object Required

According to the below, referenced article (authored by Sue Mosherwho I guess is a top of the line Outlook expert), this is because "the Outlook object model does not support an intrinsic Selection object". Code is provided within the article which is designed to enable the Outlook message to access a Word.Selection object. However, when I attempted to incorporate this code into Outlook Visual Basic editor to run a test macro, I got the following error message:

---------------------------------------------- Compile error:
User-defined type not defined
Should I be modifying this code to a greater extent? I have some VB experience as a student, but not on a pro level. Regardless, I would like to be able to get my user to be able to run her macros within an Outlook e-mail.!C1013F1F9A99E3D8!579.entry&sa=79757417



Typically that error message is a sign that you did not reference the Word object library in Outlook's Visual Basic Editor (VBE). Without doing this, Outlook VBA code wouldn't know what a "Word" object is in your code. So in the VBE, be sure to go to Tools / References and then scroll down in the list to enable the "Microsoft Word 12.0 Object Library" (I believe that's what it's called, I don't have an Office 2007 machine in front of me at the moment).

Bill Jacob
Microsoft Customer Service and Support - Messaging Developer
Not open for further replies.