![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |