0

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 Answers1

0

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

Eric
  • 181
  • 2
  • If I may, how would one access this in VBA? Can I simply assign an decimal calculated as above to the RecurrencePattern.StarTime property? – flyingscotsman74656 Aug 07 '12 at 19:45
  • Your best resource to understand objects and their properties is – Eric Aug 08 '12 at 00:32
  • MSDN [link](http://msdn.microsoft.com/en-us/library/office/ff862177.aspx this page has a good example of creating instances of the objects you are working with and setting their properties. – Eric Aug 08 '12 at 00:34
  • You seem to have trying to solve your problem for a while. You have started 5 threads on what I think is the same problem. The closest you got to an answer was in http://stackoverflow.com/questions/11785074/how-to-modify-properties-time-zone-of-recurring-appointments-in-outlook-2010-v Would you like me to add to this thread instead of here? I have a solution if you haven't already found it yourself. – Eric Aug 08 '12 at 01:19
  • Each of those threads represents a different facet of a continually changing solution, st one point it seems that one method will work but doesn't always pan out (call it hedging my bets). To which problem do you have a solution, I would love to hear it if you have a chance to post it. – flyingscotsman74656 Aug 08 '12 at 04:19