More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

forum 19-Sep-2014 20:53

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

Login Password
Remember me
Register | Send my password
    Page [ 1 ]  
 Basic Outlook Printer Friendly Version
Working with Outlook items, folders, recipients; dealing with security; writing event handlers
Topic
Calendar: How to show the absolute day of the year?
I want that Outlook (2003) shows the absolute day of the year. For example, February 9th is the 40th day of the year (and 325 remaining). July 27th is the 208th day of the year (and 157 remaining). How to do it? Thanks in advance

  23-Jan-2009  09:59
  24-Jan-2009  13:53   
These functions will get the information but where or how do you want to show it?

Sub Test()
    Dim d As Date
    d = Now 'use today's date
    MsgBox DayOfYear(d)
    MsgBox DaysRemainingInYear(d)
End Sub

Function DayOfYear(SomeDate As Date) As Integer
    DayOfYear = DateDiff("y", "1-1-" & Year(SomeDate), SomeDate) + 1
End Function

Function DaysRemainingInYear(SomeDate As Date) As Integer
    DaysRemainingInYear = DateDiff("y", SomeDate, "31-12-" & Year(SomeDate))
End Function

I hope this is of some help to you.
    Page [ 1 ]