Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / February 2008

Tip: Looking for answers? Try searching our database.

Don't "see" my macro when I try to run it

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoeLiuzzo - 27 Feb 2008 22:16 GMT
Writing my first VBA for Outlook 2003, although I have written many for
EXCEL. I created the macro and saved VBAProhect.OTM, but then when I return
to Outlook and choose Tools|Macro|Macros.., there are no entries and
everything is diabled except 'Cancel'.  If I type the name in the text box,
then the "Create" command is enabled & when I click it, I am brought to the
VBA_Editor with my pre-existing code sitting there and the shell of a new
function below it.
What's the magic action that has to happen to get the coded macros to be
available to the Outlook app?
thanks
Sue Mosher [MVP-Outlook] - 27 Feb 2008 22:43 GMT
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

> Writing my first VBA for Outlook 2003, although I have written many for
> EXCEL. I created the macro and saved VBAProhect.OTM, but then when I return
[quoted text clipped - 6 lines]
> available to the Outlook app?
> thanks
JoeLiuzzo - 27 Feb 2008 23:36 GMT
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? :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.