How do create a macro to forward email to a specific address?

Discussion in 'Microsoft Outlook Discussion' started by Guest, Dec 23, 2006.

  1. Guest

    Guest Guest

    I use OfficeXP Outlook for email. I want to be able to use a macro or
    shortcut to
    select a message header, then enter a 2-3 key shortcut to forward the
    message to
    a specific address as an attachment and then delete the original message.
    Tools => Macros just brings up the VB editor. I don't know how to use it,
    or how
    to begin interfacing with Outlook. Is there an easier way, such as a
    keystroke
    recorder?
    --
    ArloSmurf
     
    Guest, Dec 23, 2006
    #1
    1. Advertisements

  2. "ArloSmurf" <> wrote in message
    news:...
    >I use OfficeXP Outlook for email. I want to be able to use a macro or
    > shortcut to
    > select a message header, then enter a 2-3 key shortcut to forward the
    > message to
    > a specific address as an attachment and then delete the original message.
    > Tools => Macros just brings up the VB editor. I don't know how to use
    > it,
    > or how
    > to begin interfacing with Outlook. Is there an easier way, such as a
    > keystroke
    > recorder?
    > --
    > ArloSmurf



    No keystroke recorder in OL, so you would have to learn vbscript. But you
    can get external windows programs that will do this (google for macro or
    keystroke recorder). Unless you can achieve what you need using a rule in OL
    --
    John Blessing

    http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    businesses
    http://www.room-booking-software.com - Schedule rooms & equipment bookings
    for your meeting/class over the web.
    http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
    send newsletters
     
    John Blessing, Dec 24, 2006
    #2
    1. Advertisements

  3. For VBA basics, see http://www.outlookcode.com/d/vbabasics.htm Once you have your macro security set and can get a Hello World message working, you can try putting this code in a new code module:

    Sub ForwardA()
    Dim objMail As Outlook.MailItem
    Set objItem = GetCurrentItem()
    Set objMail = objItem.Forward
    objMail.To = ""
    objMail.Display
    Set objItem = Nothing
    Set objMail = Nothing
    End Sub

    Sub ForwardB()
    Dim objMail As Outlook.MailItem
    Set objItem = GetCurrentItem()
    Set objMail = objItem.Forward
    objMail.To = ""
    objMail.Display
    Set objItem = Nothing
    Set objMail = Nothing
    End Sub

    Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application
    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
    Case "Explorer"
    Set GetCurrentItem = _
    objApp.ActiveExplorer.Selection.Item(1)
    Case "Inspector"
    Set GetCurrentItem = _
    objApp.ActiveInspector.CurrentItem
    Case Else
    End Select
    End Function

    ForwardA and ForwardB are macros that each forward the current item to a different person.

    For shortcuts, you'll need to add them to your toolbar (View | TOolbars | Customize); see http://www.slipstick.com/outlook/toolbar.htm#macro

    --
    Sue Mosher, Outlook MVP
    Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
    and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

    "ArloSmurf" <> wrote in message news:...
    >I use OfficeXP Outlook for email. I want to be able to use a macro or
    > shortcut to
    > select a message header, then enter a 2-3 key shortcut to forward the
    > message to
    > a specific address as an attachment and then delete the original message.
    > Tools => Macros just brings up the VB editor. I don't know how to use it,
    > or how
    > to begin interfacing with Outlook. Is there an easier way, such as a
    > keystroke
    > recorder?
    > --
    > ArloSmurf
     
    Sue Mosher [MVP-Outlook], Jan 5, 2007
    #3
  4. Guest

    Guest Guest

    Thank you Sue,

    I entered this into a new VB code module and saved it, then set it up on my
    toolbar
    as SPAM -- saves me a few steps each time I use it to report spam to comcast
    and the
    national spam center.

    Sub SPAM()
    Dim objMail As Outlook.MailItem
    Set objItem = GetCurrentItem()
    Set objMail = objItem.Forward
    objMail.To = "; "
    objMail.Display
    Set objItem = Nothing
    Set objMail = Nothing
    End Sub

    Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application
    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
    Case "Explorer"
    Set GetCurrentItem = _
    objApp.ActiveExplorer.Selection.Item(1)
    Case "Inspector"
    Set GetCurrentItem = _
    objApp.ActiveInspector.CurrentItem
    Case Else
    End Select
    End Function


    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

    End Sub

    --
    ArloSmurf


    "Sue Mosher [MVP-Outlook]" wrote:

    > For VBA basics, see http://www.outlookcode.com/d/vbabasics.htm Once you have your macro security set and can get a Hello World message working, you can try putting this code in a new code module:
    >
    > Sub ForwardA()
    > Dim objMail As Outlook.MailItem
    > Set objItem = GetCurrentItem()
    > Set objMail = objItem.Forward
    > objMail.To = ""
    > objMail.Display
    > Set objItem = Nothing
    > Set objMail = Nothing
    > End Sub
    >
    > Sub ForwardB()
    > Dim objMail As Outlook.MailItem
    > Set objItem = GetCurrentItem()
    > Set objMail = objItem.Forward
    > objMail.To = ""
    > objMail.Display
    > Set objItem = Nothing
    > Set objMail = Nothing
    > End Sub
    >
    > Function GetCurrentItem() As Object
    > Dim objApp As Outlook.Application
    > Set objApp = Application
    > On Error Resume Next
    > Select Case TypeName(objApp.ActiveWindow)
    > Case "Explorer"
    > Set GetCurrentItem = _
    > objApp.ActiveExplorer.Selection.Item(1)
    > Case "Inspector"
    > Set GetCurrentItem = _
    > objApp.ActiveInspector.CurrentItem
    > Case Else
    > End Select
    > End Function
    >
    > ForwardA and ForwardB are macros that each forward the current item to a different person.
    >
    > For shortcuts, you'll need to add them to your toolbar (View | TOolbars | Customize); see http://www.slipstick.com/outlook/toolbar.htm#macro
    >
    > --
    > Sue Mosher, Outlook MVP
    > Author of Configuring Microsoft Outlook 2003
    > http://www.turtleflock.com/olconfig/index.htm
    > and Microsoft Outlook Programming - Jumpstart for
    > Administrators, Power Users, and Developers
    > http://www.outlookcode.com/jumpstart.aspx
    >
    > "ArloSmurf" <> wrote in message news:...
    > >I use OfficeXP Outlook for email. I want to be able to use a macro or
    > > shortcut to
    > > select a message header, then enter a 2-3 key shortcut to forward the
    > > message to
    > > a specific address as an attachment and then delete the original message.
    > > Tools => Macros just brings up the VB editor. I don't know how to use it,
    > > or how
    > > to begin interfacing with Outlook. Is there an easier way, such as a
    > > keystroke
    > > recorder?
    > > --
    > > ArloSmurf

    >
     
    Guest, Jan 7, 2007
    #4
  5. Guest

    Guest Guest

    Thanks for thehelp John,

    I want to use this to report spam -- since the "senders" change
    addresses each week, a rule only works for a short time.

    --
    ArloSmurf


    "John Blessing" wrote:

    > "ArloSmurf" <> wrote in message
    > news:...
    > >I use OfficeXP Outlook for email. I want to be able to use a macro or
    > > shortcut to
    > > select a message header, then enter a 2-3 key shortcut to forward the
    > > message to
    > > a specific address as an attachment and then delete the original message.
    > > Tools => Macros just brings up the VB editor. I don't know how to use
    > > it,
    > > or how
    > > to begin interfacing with Outlook. Is there an easier way, such as a
    > > keystroke
    > > recorder?
    > > --
    > > ArloSmurf

    >
    >
    > No keystroke recorder in OL, so you would have to learn vbscript. But you
    > can get external windows programs that will do this (google for macro or
    > keystroke recorder). Unless you can achieve what you need using a rule in OL
    > --
    > John Blessing
    >
    > http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    > businesses
    > http://www.room-booking-software.com - Schedule rooms & equipment bookings
    > for your meeting/class over the web.
    > http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
    > send newsletters
    >
    >
    >
     
    Guest, Jan 7, 2007
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    trying to forward email but dont want to forward spam how?

    Guest, Jun 7, 2005, in forum: Microsoft Outlook Discussion
    Replies:
    1
    Views:
    331
    Lanwench [MVP - Exchange]
    Jun 7, 2005
  2. Andibevan

    Form to forward mail to a specific e-mail address

    Andibevan, Jul 22, 2005, in forum: Microsoft Outlook Discussion
    Replies:
    4
    Views:
    183
    Andibevan
    Jul 22, 2005
  3. Skieruk

    automatically forward a message from 1 specific address

    Skieruk, Jan 15, 2008, in forum: Microsoft Outlook Discussion
    Replies:
    1
    Views:
    197
  4. nugget.man

    Receiving Email but cannot create new,reply or forward Email on

    nugget.man, Aug 20, 2009, in forum: Microsoft Outlook Discussion
    Replies:
    4
    Views:
    259
    Roady [MVP]
    Aug 24, 2009
  5. nevin009
    Replies:
    0
    Views:
    821
    nevin009
    Apr 14, 2011
Loading...

Share This Page