Ever wanted to reserve Islamic prayer times in your Outlook calendar? Ever wanted to get reminded about prayer times like normal Outlook meetings? OPT is the right tool for you. It calculates Islamic prayer times and book a corresponding meeting request in your Outlook calendar.
OPT is developed as Outlook macros using open source VBA. It is based on prayer time code posted on [PrayerTimes.org] 1.
0.9
-
Please note that this method is risky as highlighted in this [KB] 2. This method works if you do not have existing macros in Outlook.
-
Enable the developer tab as highlighted [here] 3.
-
Enable Outlook to run macros:
-
Go to developer tab.
-
Click on Macros Security.
-
In Macros Settings, select Notifications for all macros.
-
Click Ok.
-
Close Outlook if it is open.
-
Open %appdata%\Microsoft\Outlook
-
Take a backup of VbaProject.OTM if available.
-
Download VbaProject.OTM from OPT and replace your default VbaProject.OTM.
-
Restart Outlook.
-
At startup, Outlook will ask to enable macros. Grant it.
-
Switch to Calendar view, to verify the new green prayer times meetings'.
-
If the prayer times do not reflect your current location look at the long installation steps.
-
Download the code directly from GitHub and save it to a local directory.
-
Enable the developer tab as highlighted [here] 3.
-
Enable Outlook to run macros:
-
Go to developer tab.
-
Click on Macros Security.
-
In Macros Settings, select Notifications for all macros.
-
Click Ok.
-
Still in developer tab, import OPT code as following:
-
Click Visual Basic.
-
Expand Microsoft Outlook Objects, double click ThisOutlookSession, and copy and paste ThisOutlookSession.bas into the newly opened code window.
-
From the menu, click Insert -> Module. In the module properties, change the module name to FillCalendar. Copy and paste FillCalendar.bas into the newly opened code window.
-
From the menu click Insert -> Class Module. In the class module properties, change the class module name to ItemEvents. Copy and paste ItemEvents.bas into the newly opened code window.
-
Repeat step iv, for PrayerTime.bas.
-
The Outlook project should look like this:
-
Double click on FillCalendar to open it. Adjust the code shown blow to reflect your country and time zone. Please note that DayLightSaving is not currently used.
' Edit these to reflect your country Public Const TimeZone As Double = 3# Public Const DayLightSaving As Double = 0 Public Const Latitude As Double = 30.0566 Public Const Longitude As Double = 31.2262
-
Do not forget to save by clicking the save icon.
-
Close Microsoft Visual Basic for Applications window.
-
Restart Outlook.
-
At startup, Outlook will ask to enable macros. Grant it.
-
Switch to Calendar view, to verify the new green prayer times meetings'.
- Perform the steps in this [article] 4 to self-sign you macros.
- If you face any issues try to follow the steps in the most helpful reply in this [thread] 5.
LGPL