Did you in fact create a macro -- an argumentless public subroutine -- and not some other kind of procedure?
Also, if you created a new module, use a different name for the procedures in that module. I've heard of some problems when module and procedure name are the same.

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
No, I guess I did not. I was basing my code on a snippet I found here in the
forum and it has an argument, as in MyCode(Item As Outlook.MailItem). If
that's not a macro, then what is it? Bottom line is I'm trying to code
something I can execute from the "run a script" option of the Outlook rules.
Am I barking up the wrong tree? Am I even in the forest? :)
> Did you in fact create a macro -- an argumentless public subroutine -- and not some other kind of procedure?
>
[quoted text clipped - 10 lines]
> > available to the Outlook app?
> > thanks
Sue Mosher [MVP-Outlook] - 28 Feb 2008 02:32 GMT
That's definitely not a macro, because it has a parameter. Most likely, it's a procedure designed for use with a "run a script" rule from the Outlook Rules Wizard, which sounds like exactly what you're looking for. Such a procedure can't be run from the Macros dialog, because it needs something to pass it the MailItem, in other words to give it the item to process. Why not go ahead and set up a rule to run it?

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> No, I guess I did not. I was basing my code on a snippet I found here in the
> forum and it has an argument, as in MyCode(Item As Outlook.MailItem). If
[quoted text clipped - 16 lines]
>> > available to the Outlook app?
>> > thanks
JP - 28 Feb 2008 14:26 GMT
If your macro has information passed to it via arguments, it won't be
available as a procedure in Outlook, because how would you pass the
arguments to the macro? You would have to write a second macro (with
no arguments) that calls the first macro.
Sue has an example on her site: http://www.outlookcode.com/codedetail.aspx?id=615
Sub InsertSig(strSigName As String) <-- inserts signature in an email
To call the above macro, you would need a second macro to pass the
strSigName argument:
Sub InsertMySig()
Call InsertSig("Name of your signature")
End Sub
HTH,
JP
On Feb 27, 6:36 pm, JoeLiuzzo <JoeLiu...@discussions.microsoft.com>
wrote:
> No, I guess I did not. I was basing my code on a snippet I found here in the
> forum and it has an argument, as in MyCode(Item As Outlook.MailItem). If
> that's not a macro, then what is it? Bottom line is I'm trying to code
> something I can execute from the "run a script" option of the Outlook rules.
> Am I barking up the wrong tree? Am I even in the forest? :)