Tuesday, November 3, 2015

Get Daily Summary of Ms Outlook Calendar Events as an Email (like Google Calendar)

SNAGHTML9ae0bc2

In Google Calendar there is an option to receive email on daily events, Google stopped providing free sync b/w Google calendar and Ms Outlook which made me leave the Google calendar, thus I started looking for a way to have similar email for events of Ms Outlook 2010 Calendar.

David Lee on Quora provided the solution. The above can be achieved by using a VBA script. Plz find below the script which should work on Windows computers using Office 2007 and later:

Instructions:

  1. Open Notepad
  2. Copy the code below and paste it into Notepad
  3. On line 10, edit the email address you want the summary sent to
  4. Save the file.  Name it anything you want, the extension must be .vbs
  5. Using Windows task scheduler, create a new task that runs each morning
  6. Set the task to run this script

Customization:

  1. If you want to send email to a 2nd email address as well then uncomment line 11 (remove ‘) and edit the email address
  2. If you don’t want to receive the confirmation notification then comment line 30 (add ‘)

 

   1: 'VBA Script to Send Daily Summary Email of Outlook Events
   2: 'Developed by David Lee techniclee.wordpress.com
   3: 'Little Modifications by Nauman Khan naumankhan.blogspot.com
   4:  
   5: Const olCalendarMailFormatDailySchedule = 0
   6: Const olFreeBusyAndSubject = 1
   7: Const olFullDetails = 2
   8: Const olFolderCalendar = 9
   9:  
  10: SendAgenda "someone@company.com", Date, Date
  11: 'SendAgenda "someone2@company.com", Date, Date
  12:  
  13: Sub SendAgenda(strAdr, datBeg, datEnd)
  14:     Dim olkApp, olkSes, olkCal, olkExp, olkMsg
  15:  
  16:     Set olkApp = CreateObject("Outlook.Application")
  17:     Set olkSes = OlkApp.GetNameSpace("MAPI")
  18:     olkSes.Logon olkApp.DefaultProfileName
  19:     Set olkCal = olkSes.GetDefaultFolder(olFolderCalendar)
  20:     Set olkExp = olkCal.GetCalendarExporter
  21:     
  22:     With olkExp
  23:         .CalendarDetail = olFreeBusyAndSubject
  24:         '.IncludeAttachments = True
  25:         '.IncludePrivateDetails = True
  26:         .RestrictToWorkingHours = False
  27:         .StartDate = datBeg
  28:         .EndDate = datEnd
  29:     End With
  30:     msgbox "Calendar Summary Emailed"
  31:     Set olkMsg = olkExp.ForwardAsICal(olCalendarMailFormatDailySchedule)
  32:     With olkMsg
  33:         .To = strAdr
  34:         .Send
  35:     End With
  36:     
  37:     Set olkCal = Nothing
  38:     Set olkExp = Nothing
  39:     Set olkMsg = Nothing
  40:     olkSes.Logoff
  41:     Set olkSes = Nothing
  42:     Set olkApp = Nothing
  43: End Sub

 


If you are unaware of how to schedule a task in Windows Scheduler then here are the details:


Following are 2 guides on how to schedule a task in windows:



























 






 










How to Automatically Run Programs and Set Reminders With the Windows Task Scheduler

 

Do you want your computer to automatically run a program, remind you about something, or even automatically send emails? Use the Task Scheduler included with Windows – its interface can be a bit intimidating, but it’s easy to use.

 






Clip Better http://www.howtogeek.com/123393/how-to-automaticall…

 








   View Now 

 
 


























 






 










Windows 10 Task Scheduler Access, Functions, Operation, Summary

 

How to Access Windows 10 Task Scheduler (2 processes), Operate the Library, summary and action and what data the six tabs like general, trigger offer.

 






Clip Better http://www.howto-connect.com/windows-10-task-schedu…

 








   View Now 

 
 



While giving the path of the VBA script you will have to use a prefix ‘cscript’ to make it work properly. Details can be found in the answer given by Steve Kline on the following link:



























 






 










How to run a vbs file using task scheduler?

 


 






Clip Better http://social.technet.microsoft.com/Forums/windowss…

 








   View Now 

 
 

If there is a possibility that the PC/laptop will be off at the scheduled running time of the script then you can use the following option:



























 






 










Will Windows Scheduled Tasks execute if the computer was off at the scheduled time?

 

If I schedule a task using windows task scheduler for, say, 2 minutes from now, and for some reason the computer is shut down 1 minute from now, and turned on 3 minutes from now, will the task that...

 






Clip Better http://superuser.com/questions/312552/will-windows-…

 








   View Now 

 
 

 


Link to my Question on Quora:



























 






 










Is there anyway to get daily summary of Ms Outlook Calendar events as an email? - Quora

 


 






Clip Better http://www.quora.com/Is-there-anyway-to-get-daily-s…

 








   View Now 

 
 


-urShadow


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...