Download for the Outlook 2007 MAPI Reference is now available!

You can now download the Outlook 2007 MAPI Reference from the Microsoft Download Center at http://www.microsoft.com/downloads/details.aspx?FamilyID=4b1b8b22-3c74-4479-bd0d-7b0ee29e8d59&displaylang=en ! Since my last blog post in January, it seems like the major search engines have made some progress on their crawling. When you search for some commonly used MAPI names today, like PidTagBody and IABContainer::IMAPIContainer , the more popular search engines return them on the first page of their search results. While the search engines are still working their way through the approximately 1500 APIs in the Outlook 2007 MAPI reference, you now have a choice to download this reference, install it on your computer in Compiled HTML (CHM) format, view it at your convenience, and search in this CHM file when you are not connected to the Internet.

Go here to read the rest:
Download for the Outlook 2007 MAPI Reference is now available!

Download the Outlook 2007 MAPI Reference

Learn how to create Outlook 2007 items by using MAPI that is based on the Component Object Model (COM) rather than the Outlook object model.

Originally posted here:
Download the Outlook 2007 MAPI Reference

Use VBA To Reset Task Due Dates in Outlook

There was an earlier version of this post. It had more words and as it went on and on about how I track damn near everything in Outlook. It’s true. Everything. If I don’t track something I want to do or have to do as an Outlook task, it won’t get done.

I deleted that post by accident as I thought I was deleting something else. As it turns out, the wrong Window had the focus when I hit the Delete button and I deleted this post. Dammit!

Anyways, I always fall way behind on the deadlines I set for my tasks. So each Monday morning, I set the deadlines to a week from the current day.

Here is the VBA code to achieve this.

Sub ResetTaskDeadlines()
    Dim ns As NameSpace
    Dim fld As Folder
    Dim task As TaskItem
    Dim items As Outlook.items
    Dim rest As Outlook.items
    Dim filterSQL As String

    Set ns = Application.GetNamespace("MAPI")
    Set fld = ns.GetDefaultFolder(olFolderTasks)
    Set items = fld.items
    filterSQL = "@SQL=" & """http://schemas.microsoft.com/mapi/id/"
    filterSQL = filterSQL & "{00062003-0000-0000-C000-000000000046}/"
    filterSQL = filterSQL & "81010003""" & " <> 2"
    Set rest = items.Restrict("[Status] <> 'Completed'")

    For Each task In rest
    ''UNCOMMENT THE OPTION YOU WANT TO USE
        ''task.DueDate = "1/1/4501" 'Set to NO Due Date
        ''task.DueDate = task.DueDate + 7 ' Set to 7 days from current due date
        task.DueDate = today() + 7 'Set to a week from today
        ''task.DueDate = FirstDayOfNextMonth ' Set to first day of next month
        'task.Save
    Next

End Sub

Function FirstDayOfNextMonth() As Date
   Dim d As Date
   d = Date
   FirstDayOfNextMonth = DateSerial(Year(d), Month(d) + 1, 1)
End Function

I pretty much use VSTO to build Outlook add-ins professionally. But for quick personally useful scripts like this, VBA still reins.