Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Create & run a macro in Outlook 2007  (Read 5946 times)

0 Members and 1 Guest are viewing this topic.

rmccafferty

  • Guest
Create & run a macro in Outlook 2007
« on: January 20, 2009, 02:28:16 PM »
I had a macro in Outlook XP that entered a certain amount of text and formatted it.  We use it in most of our emails and immediately run it when creating a new email.  It worked fine.  (For what it is worth, I copied it into a Word 2007 macro and it worked fine there also).

I cannot figure out to create this macro in Outlook 2007.  I went to trust center and enabled all macros with no security at all.

I went to Tools, Macros, Visual Basic Editor.  In the top left box I created a new module and pasted in the text of the macro.  But now I cannot figure out how to run it in a new email.  In a newly created macro there is no tool option to call up a macro.

I try to run it within the visual basic editor, but I get an error message that says macros in this project are disabled and refers me to online help for how to enable macros.

How do I create a macro that I can run upon opening a new email that is to be sent?

If it matters at all, the text in the macro is:
Sub EmailProtocol()
'
' EmailProtocol Macro
' Macro recorded 8/22/2006 by Gisele Prive
'
    Selection.InsertDateTime DateTimeFormat:="d-MMM-yy", InsertAsField:=False, _
         DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
        InsertAsFullWidth:=False
    Selection.TypeText Text:="  "
    Selection.InsertDateTime DateTimeFormat:="HH:mm", InsertAsField:=False, _
        DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
        InsertAsFullWidth:=False
    Selection.TypeText Text:=" PST  "
    Selection.MoveLeft Unit:=wdCharacter, Count:=2
    Selection.MoveLeft Unit:=wdCharacter, Count:=9, Extend:=wdExtend
    Selection.Font.Bold = wdToggle
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:="-- Folder"
    Selection.TypeParagraph
    Selection.TypeParagraph
    Selection.TypeText Text:="Message Subject >  "
    Selection.MoveUp Unit:=wdLine, Count:=2
    Selection.MoveRight Unit:=wdWord, Count:=2
End Sub