![]() |
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
|
|||
|
|||
![]()
Now you got it. Congrats!
--JP On Mar 11, 7:16*pm, Gabe wrote: I think I answered my own question, I just had to put in a case statement in. Here is the final. Thanks again. Sub MyFunction() * * Dim olApp As Outlook.Application * * Dim olMsg As Outlook.MailItem * * Dim MyMonth * * MyMonth = Month(Date) 'current month * * Select Case MyMonth * * * * Case 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12 'if the current month (MyMonth) equals these months then send this message * * * * * * Set olApp = Outlook.Application * * * * * * Set olMsg = olApp.CreateItem(olMailItem) * * * * * * * * With olMsg * * * * * * * * .To = " * * * * * * * * .Subject = "Monthly Report" * * * * * * * * .Attachments.Add ("C:\test.doc") * * * * * * * * .Display * * * * * * * * .BodyFormat = olFormatHTML * * * * * * * * .HTMLBody = "HTMLHHello,/H2BODYBLOCKQUOTEAttached is the monthly report./BLOCKQUOTE/BODY/HTMLHBODYThanks./HTML" & .HTMLBody * * * * * * * * End With * * * * * * Set olMsg = Nothing * * * * * * Set olApp = Nothing * * End Select * * Select Case MyMonth * * * * Case 3, 4 'if the current month (MyMonth) equals these months then send this message * * * * * * Set olApp = Outlook.Application * * * * * * Set olMsg = olApp.CreateItem(olMailItem) * * * * * * * * With olMsg * * * * * * * * .To = " * * * * * * * * .Subject = "Monthly Report" * * * * * * * * .Attachments.Add ("C:\test.doc") * * * * * * * * .Display * * * * * * * * .BodyFormat = olFormatHTML * * * * * * * * .HTMLBody = "HTMLHHello,/H2BODYBLOCKQUOTEAttached is the monthly report./BLOCKQUOTE/BODY/HTMLHBODYThanks./HTML" & .HTMLBody * * * * * * * * End With * * * * * * Set olMsg = Nothing * * * * * * Set olApp = Nothing * * End Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calendar - Monthly | alleycat | Outlook - General Queries | 1 | September 25th 07 08:54 PM |
monthly calendar | alleycat | Outlook - General Queries | 0 | September 24th 07 10:22 PM |
monthly calendar | alleycat | Outlook - General Queries | 0 | September 24th 07 10:00 PM |
monthly calendar | alleycat | Outlook - General Queries | 1 | September 24th 07 03:50 AM |
Can's able to recieve mails but sending mails | About Outlook Configuration | Outlook - General Queries | 4 | July 5th 06 06:00 PM |