A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 27th 08, 10:16 PM posted to microsoft.public.outlook.program_vba
JoeLiuzzo
external usenet poster
 
Posts: 4
Default Don't "see" my macro when I try to run it

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
Ads
  #2  
Old February 27th 08, 10:43 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Don't "see" my macro when I try to run it

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.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"JoeLiuzzo" wrote in message news
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

  #3  
Old February 27th 08, 11:36 PM posted to microsoft.public.outlook.program_vba
JoeLiuzzo
external usenet poster
 
Posts: 4
Default Don't "see" my macro when I try to run it

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?

"Sue Mosher [MVP-Outlook]" wrote:

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.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"JoeLiuzzo" wrote in message news
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


  #4  
Old February 28th 08, 02:32 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Don't "see" my macro when I try to run it

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?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"JoeLiuzzo" wrote in message ...
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?

"Sue Mosher [MVP-Outlook]" wrote:

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.

"JoeLiuzzo" wrote in message news
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


  #5  
Old February 28th 08, 02:26 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Don't "see" my macro when I try to run it

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
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?

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to extract subject line and "paste" in advanced search stef Outlook and VBA 2 August 20th 06 11:24 PM
Re-Post: macro to extract subject line and "paste" in advanced search stef Outlook and VBA 5 August 8th 06 11:02 PM
Re-Post: macro to extract subject line and "paste" in advanced search stef Add-ins for Outlook 0 August 7th 06 01:45 AM
macro to extract subject line and "paste" in advanced search stef Add-ins for Outlook 0 August 2nd 06 04:21 PM
Macro to add calendar items from "birthday" field of imported cont Peter K. Outlook and VBA 2 April 6th 06 02:32 PM


All times are GMT +1. The time now is 03:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.