Run multiple Macros or macros from within other macros ?

I would like to run multiple macros at startup.  What code should be used in 
the Private Sub Application_Startup command in the ThisOutlookSession area ?

If the names of my macros were below what would the code to look like ?
Macro1
Macro2
Macro3

I have looked at the samples from previous posts and cannot determine how to 
make them apply specifically to my needs.

In Excel you can use the Run "Macro1" line and it would run that macro.  Run 
does not work in Outlook I suppose because I kept getting an error.

****
Also - What code is needed to execute a macro from within a different macro 
in the same Module ?  Once again, Run would not work.  What code is needed if 
you wanted to run a different macro that was located inside a different 
Module ?

Thoughts ?

Thanks!

0
Utf
2/10/2010 8:00:01 PM
outlook.program_vba 490 articles. 0 followers. Follow

2 Replies
804 Views

Similar Articles

[PageSpeed] 49

Just use the macro name or prefix it with Call, e.g.:

    Macro1
    Macro2
    Macro3

or

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


"vbaNEWBIE" <vbaNEWBIE@discussions.microsoft.com> wrote in message 
news:F6B29993-5C61-4C8A-ACE5-D0B3817FC22E@microsoft.com...
>I would like to run multiple macros at startup.  What code should be used 
>in
> the Private Sub Application_Startup command in the ThisOutlookSession area 
> ?
>
> If the names of my macros were below what would the code to look like ?
> Macro1
> Macro2
> Macro3
>
> I have looked at the samples from previous posts and cannot determine how 
> to
> make them apply specifically to my needs.
>
> In Excel you can use the Run "Macro1" line and it would run that macro. 
> Run
> does not work in Outlook I suppose because I kept getting an error.
>
> ****
> Also - What code is needed to execute a macro from within a different 
> macro
> in the same Module ?  Once again, Run would not work.  What code is needed 
> if
> you wanted to run a different macro that was located inside a different
> Module ?
>
> Thoughts ?
>
> Thanks!
> 


0
Sue
2/10/2010 8:41:30 PM
Thanks Sue, that works great!  :-)  I appreciate it!

"Sue Mosher [MVP]" wrote:

> Just use the macro name or prefix it with Call, e.g.:
> 
>     Macro1
>     Macro2
>     Macro3
> 
> or
> 
>     Call Macro1
>     Call Macro2
>     Call Macro3
> -- 
> Sue Mosher, Outlook MVP
>    Author of Microsoft Outlook 2007 Programming:
>      Jumpstart for Power Users and Administrators
>     http://www.outlookcode.com/article.aspx?id=54
> 
> 
> "vbaNEWBIE" <vbaNEWBIE@discussions.microsoft.com> wrote in message 
> news:F6B29993-5C61-4C8A-ACE5-D0B3817FC22E@microsoft.com...
> >I would like to run multiple macros at startup.  What code should be used 
> >in
> > the Private Sub Application_Startup command in the ThisOutlookSession area 
> > ?
> >
> > If the names of my macros were below what would the code to look like ?
> > Macro1
> > Macro2
> > Macro3
> >
> > I have looked at the samples from previous posts and cannot determine how 
> > to
> > make them apply specifically to my needs.
> >
> > In Excel you can use the Run "Macro1" line and it would run that macro. 
> > Run
> > does not work in Outlook I suppose because I kept getting an error.
> >
> > ****
> > Also - What code is needed to execute a macro from within a different 
> > macro
> > in the same Module ?  Once again, Run would not work.  What code is needed 
> > if
> > you wanted to run a different macro that was located inside a different
> > Module ?
> >
> > Thoughts ?
> >
> > Thanks!
> > 
> 
> 
> .
> 
0
Utf
2/10/2010 10:14:02 PM
Reply:

Similar Artilces:

Header and Footer within a transaction file.
Good Day To all: I'm trying to devise a way to concatenate 3 text files to form one flat file within a macro. The object of this exercise to include a header and footer record within a file that has transactions. Can anyone provide a suggestion in to how to achieve this? Hi Ken Can you give more information What are "text files" in this context What does this mean "include a header and footer record" -- Wayne Manchester, England. "Ken" wrote: > Good Day To all: > > I'm trying to devise a way to concatenate 3 text files to form one ...

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

multiple worksheets in html
I want to create a workbook with multiple worksheets in html format. This is easy to do by creating one file per sheet and loading each into my workbook using '<x:WorksheetSource HRef="filename"/>'. This, however, results in 3+ files for 2 worksheets. I would like to put all of the data in one file. Is this possible? thanks, -mikael ...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

deleting multiple records from access
Hello I have a simple database with about 500000 records I want to know if there is a way to quickly erase a large number of records at once, using access. I want to mark and then delete, but I can't mark a large number of records thank you john John, Is there some logic as to which records you'll keep, and which you'll delete? If so, then you could develop a Delete query that would do that for you. Are you deleting all of them? If so, just delete the table. What do you mean by "mark?" Do you mean use the Record Selectors in tabl...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

Extracting Email Addresses within Message
Help! I have been receiving a very large amount of returned email errors. Over 200. In order to properly investigate and validate email addresses enclosed in each returned email error message, I need to create a complete list of them. Without going into each and everyone to cut & paste. That would take way longer than I have available. Is there a method or freeware utilities that could extract all email addresses from within the message area of each email automatically? Thank in advance. //Ken The root-cause of these messages are probably spammers and virus-infected machines on the...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

best database to use for multiple attendence at meetings
I need a database which lists a group attending meeteings weekly for 2 years and the date on which they attended alsoif they were overnight or day only attendees. thank you. Access will work fine. "peggysue43" wrote: > I need a database which lists a group attending meeteings weekly for 2 years > and the date on which they attended alsoif they were overnight or day only > attendees. > thank you. Peggy Sue. You've stated your need. Are we to assume that you expect "someone" to donate that database to you? Or do you want a template...

macro which finds last cell in a column
please help me by telling a macro which finds last cell in a column thank -- Message posted from http://www.ExcelForum.com Dim LastRow as Long LastRow = Range("A65536").End(xlUp).Row or if you just want to select it: Range("A65536").End(xlUp).Select Regards Trevor "vikram >" <<vikram.15hp0w@excelforum-nospam.com> wrote in message news:vikram.15hp0w@excelforum-nospam.com... > please help me by telling a macro which finds last cell in a column > > thanks > > > --- > Message posted from http://www.ExcelForum.com/ > ...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

Date Range within one cell
I have a date in cell A1 = 05/18/04 I need a formula for cell A2 to show a date range of A1+13days to A1+44days (end result in A2 should be something like: 5/31/04 - 7/01/04 Then, in cell A3 I have another date that represents when an item was received. I need a formula in cell A4 that will identify with a "0" or a "1" if the date the item was received (cell A3) is within the date range in cell A2. One way (leave A2 alone in the A4 formula since it refers to a1 you can use A1 since A2 will not be numerical dates) =IF(AND(A3>=A1+13,A3<=A1+44),0,1) assumi...

Macro compatibility issue between XP & 2000
A macro was developed in excel XP, no error occurred during the testing, but when the macro was tested in Excel 2000 2 errors occurred. Is there a compatibility problem between Excel XP and Excel 2000, particularly in macros? Error encountered : 1. Wrong Number of Argument or invalid property assignment In Excel 2000, by pressing Ctrl-T (Insert of rows)this message appear by continously append a row. 2. Compile Error in hidden module: this workbook. In Excel 2000, pressing Ctrl-Y (Copy) no copy taken at all. Thank you very much. - jojo Microsoft goes to great lengths (and is us...

Multiple domain and e-mail addresses in one mailbox
Hello I have recently installed exchange server 2003. I have 4 domains that I would like to be routed into the same mailbox. This works perfectly, but they all end up in the "inbox". I would like to create a rule that checks the "to address" and moves in into a folder of my choice. The problem is that it doesn't seem to matter what mailaddress I do a check on, they all come up with my mailbox name and ends up in the "inbox". I have temporary solved it with public folders but here I don't get the number of unread mail and so on so I have to check ea...

SendMail Multiple Recipients
Hello all, How does the macro code look for sending a mail to multiple recipients and a subject? The SendMail Method Example in VB Help could be a bit more detailed... Thanks in advance, Thore Hi Thore Look at the examples on my site http://www.rondebruin.nl/sendmail.htm Send the mail to more people. ..SendMail Array("ron@debruin.nl", "jelle@debruin.nl"), _ "This is the Subject line" Send to all E-mail addresses in a range Dim MyArr As Variant MyArr = Sheets("mysheet").Range("C1:C10") ..SendMail MyArr, &q...

No macros in 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I thought i was doing the right thing trying to convert to the whole office to Mac's! We run all our invoicing, accounts and stock on excel workbooks. they are now very complex and interlinked. I have automated the whole thing using macro and VBA and i feel right royally stuffed! <br><br><i>understand there is no easy or quick solution from what i have read on the forum. i do find it hard to believe such a useful function is just taken away.</i>&#32;<br><br>Can i run spreadsheets ...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

Outlook Still Running
I am running XP Pro with Office 2003 Pro and sometimes when I exit out of Outlook, Outlook.exe and Winword.exe stay as processes still running. Does anyone else have this problem and what can do to make sure this does not happen? Thanks for your help -- Neil Remove ABCD from Email address to reply <neil154ABCD@earthlink.net> wrote: > I am running XP Pro with Office 2003 Pro and sometimes when I exit > out of Outlook, Outlook.exe and Winword.exe stay as processes still > running. Does anyone else have this problem and what can do to make > sure this does not happ...

Pivot tables and macros
i currently use macros to change some downloaded sales information. unfortunately, the volume always changes and I cannot use a macro for creaqting a Pivot table. When i select cell A1 and hit pivot tabel it automatically selcts the range. In my macro it will only select the actual range i recorded. IS there a way to go around that? Thanks Mike You'll have to edit the macro to create a variable range (alt + F11 will bring up the VB Editor). If, for example, your macro recorded the range as "A1:D4200", you'll want to create a variable to capture the final row, th...

Reusing XPathExpression in multiple iterations
Is there some reason why I shouldn't be able to use the same XPathExpression simultaneously in multiple iterations? The test below illustrates the problem. It seems that creating two XPathNodeIterators with the same expression creates a coupling between the iterators so they always point to the same position. Anyone care to comment? [Test] public void ReuseCompiledExpr() { XmlDocument doc = new XmlDocument(); doc.LoadXml( "<Top> <A> <A1/> <A2/> </A > <B/> </Top>" ); XPathNavigator nav = doc.CreateNavigator(); XPathExpression expr...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

Personal Macro file
How do I stop my Personal Macro file from requesting to be Saved each time I exit Excel? This is very annoying and has just started happening after creating some macros to update data from certain clients. -- Mickey If you put this is a standard module you will no longer be prompted to save changes: Sub Auto_Close() ThisWorkbook.Saved = True End Sub Or alternatively, this in the ThisWorkbook module: Private Sub Workbook_BeforeClose(Cancel As Boolean) Saved = True End Sub Of course, when you do need to save changes, you must remember on your own. -- Jim "Mikey" <...