none
Problems executing Outlook 2010 Macro RRS feed

  • Question

  • New to Outlook VBA - I am trying to parse text in the body of a mail message.  I seem to be having a problem  executing macros ONLY when passing parameters:

    This Sub DOES NOT RUN and doe snot even show up on Macro list,

    Public Sub ParseBody(Body As String)

    But - if I comment out the parameters:

    Public Sub ParseBody() ' (Body As String)

    It runs - incorrectly of course - and shows up on Macro list.

    Macros enabled in Outlook. Any thoughts?

    Tuesday, July 24, 2012 4:55 PM

Answers

  • Macros can't have arguments. Otherwise they won't show up as macros.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "JimBobAnderson" <=?utf-8?B?SmltQm9iQW5kZXJzb24=?=> wrote in message news:c80b50a5-92ec-4937-b8d4-327a8cd51515...

    New to Outlook VBA - I am trying to parse text in the body of a mail message.  I seem to be having a problem  executing macros ONLY when passing parameters:

    This Sub DOES NOT RUN and doe snot even show up on Macro list,

    Public Sub ParseBody(Body As String)

    But - if I comment out the parameters:

    Public Sub ParseBody() ' (Body As String)

    It runs - incorrectly of course - and shows up on Macro list.

    Macros enabled in Outlook. Any thoughts?


    Ken Slovak MVP - Outlook
    Tuesday, July 24, 2012 5:56 PM
    Moderator

All replies

  • Macros can't have arguments. Otherwise they won't show up as macros.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "JimBobAnderson" <=?utf-8?B?SmltQm9iQW5kZXJzb24=?=> wrote in message news:c80b50a5-92ec-4937-b8d4-327a8cd51515...

    New to Outlook VBA - I am trying to parse text in the body of a mail message.  I seem to be having a problem  executing macros ONLY when passing parameters:

    This Sub DOES NOT RUN and doe snot even show up on Macro list,

    Public Sub ParseBody(Body As String)

    But - if I comment out the parameters:

    Public Sub ParseBody() ' (Body As String)

    It runs - incorrectly of course - and shows up on Macro list.

    Macros enabled in Outlook. Any thoughts?


    Ken Slovak MVP - Outlook
    Tuesday, July 24, 2012 5:56 PM
    Moderator
  • Ohhhh ... thanks ... then how do I set it up to parse message body?

    Thanks,

    JA

    Tuesday, July 24, 2012 6:50 PM
  • What message? Is it open and active? If so ActiveInspector.CurrentItem.
     
    If it's selected in an Explorer, ActiveExplorer.Selection(1).
     
    If none of those, how do you get the message?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "JimBobAnderson" <=?utf-8?B?SmltQm9iQW5kZXJzb24=?=> wrote in message news:235d0dc6-7283-4a28-b375-89b22ac61666...

    Ohhhh ... thanks ... then how do I set it up to parse message body?

    Thanks,

    JA


    Ken Slovak MVP - Outlook
    Tuesday, July 24, 2012 7:03 PM
    Moderator