0
votes

I am trying to write a VBA macro for Outlook 2010 to programatically increase the StartTime property by several hours (to counteract a post-install issue where certain appointments turned to the UTC time zone). The time zone property for recurring appointments is proving nearly impossible to fix, so I think just increasing the time (StarTime property of the RecurrencePattern for a recurring appointment) is going to be an easier fix. Since it is not an integer I can't figure out/find any way to simply increment it by a certain amount. All of the documentation I have found thus far is only about changing the property to a specific date. I deeply appreciate any help, thanks!

1

1 Answers

0
votes

Date values in MS Apps are an integer for the number of days since January 1980 (windows) and a decimal representing a point in the current day.

So 8th August 2012 at 2:54:12AM is something like 41129.1209722222

To add a day just the above number + 1 = 41130.1209722222 (easy)

To do seconds, minutes and hours you need to work out what decimal represents the time you want to add (or subtract)

One hour is represented by the decimal 0.0416666 (1 divided by 24)

One minute is 0.00069444 (1 divided by 24 divided by 60) of a 1440 minute day.

To add 20 minutes 41129.1209722222 + 0.01388888