![]() |
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
|
|||
|
|||
![]()
I'd like to send an email weekly at a certain time. I've been searching
around on the web and found a post with the following text/code. Can someone expound a bit for me? is the "ThisOutlookSession" the name of a macro? What about the "public / private"? Question: How can you get VBA in outlook to send a message on a daily or weekly basis? Thanks To andrzej and www.outlookvba.com for this answer! Set up a folder in your inbox called News Put your email in here Set a recuring appointment in the calender with the subject new, to recur when you want the email sent also set a reminder. in ThisOutlookSession add the following: Public WithEvents myOlItems As Outlook.Items Private Sub Application_Reminder(ByVal Item As Object) 'wait for reminder If Item.Sensitivity olConfidential Then If TypeOf Item Is AppointmentItem Then SendApptReminder Item End If End Sub Private Sub SendApptReminder(ByRef Item As AppointmentItem) 'Test the Subject of Reminder If Item.Subject = "news" Then sendpage2 Else End Sub 'Send news letter Private Sub sendpage2() Set ol = New Outlook.Application Set olns = ol.GetNamespace("MAPI") Set MyInboxFolder = olns.GetDefaultFolder(olFolderInbox) Set myNewsletter = MyInboxFolder.Folders("News") Then Set mynews = myNewsletter.Items(1) mynews.send End Sub |
Ads |
#2
|
|||
|
|||
![]()
The first time you use Alt+F11 to open the Outlook VBA environment, you'll see that it contains a single built-in module, named ThisOutlookSession. You can put all your code there.
FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Mr . ." wrote in message om... I'd like to send an email weekly at a certain time. I've been searching around on the web and found a post with the following text/code. Can someone expound a bit for me? is the "ThisOutlookSession" the name of a macro? What about the "public / private"? Question: How can you get VBA in outlook to send a message on a daily or weekly basis? Thanks To andrzej and www.outlookvba.com for this answer! Set up a folder in your inbox called News Put your email in here Set a recuring appointment in the calender with the subject new, to recur when you want the email sent also set a reminder. in ThisOutlookSession add the following: Public WithEvents myOlItems As Outlook.Items Private Sub Application_Reminder(ByVal Item As Object) 'wait for reminder If Item.Sensitivity olConfidential Then If TypeOf Item Is AppointmentItem Then SendApptReminder Item End If End Sub Private Sub SendApptReminder(ByRef Item As AppointmentItem) 'Test the Subject of Reminder If Item.Subject = "news" Then sendpage2 Else End Sub 'Send news letter Private Sub sendpage2() Set ol = New Outlook.Application Set olns = ol.GetNamespace("MAPI") Set MyInboxFolder = olns.GetDefaultFolder(olFolderInbox) Set myNewsletter = MyInboxFolder.Folders("News") Then Set mynews = myNewsletter.Items(1) mynews.send End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
calendar appointments show up on your delegate's calendar also? | [email protected] | Outlook - General Queries | 0 | January 25th 06 06:38 PM |
Traping AttachmentRead event on preview pane Outlook 2000 | [email protected] | Outlook - General Queries | 1 | January 18th 06 03:07 PM |
can I transfer Works calendar to Outlook calendar | claybird | Outlook - General Queries | 1 | January 13th 06 07:57 PM |
Transfer all calendar items from PST calendar to Inbox calendar | Milly Staples [MVP - Outlook] | Outlook - General Queries | 0 | January 7th 06 06:15 PM |