none
outlook auaomated messages sending RRS feed

  • Question

  • Hello,

    I'm quite confused if am I typing on the appropriate category,  but I have a question.

    i want a code that check the birthday of a contact in my outlook contact list, then sending to all other contacts an informing email to inform that that contact's birthday is held. and thank you

    Wednesday, April 6, 2016 9:29 PM

Answers

  • Hi ayman,

    >> i want a code that check the birthday of a contact in my outlook contact list, then sending to all other contacts an informing email to inform that that contact's birthday is held.

    Which step do you have issues? For a complex request, I would suggest you spilt them into many threads, and ask one request in one thread. Do you have any issues about checking birthday of a contact. You could check the ContactItem.Birthday property.

    Here is a simple code:

    Sub getContact()
    Dim olConItems As Outlook.Items
    Dim olItem As Outlook.ContactItem
    Dim olApp As Outlook.Application
    Dim olFolder As Outlook.Folder
    Set olApp = Application
    Set olFolder = olApp.GetNamespace("MAPI").GetDefaultFolder(10)
    Set olConItems = olFolder.Items
    For Each olItem In olConItems
        If TypeName(olItem) = "ContactItem" Then
            If olItem.FirstName = "Test" Then
            Debug.Print olItem.Birthday
            End If
        End If
    Next olItem

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, April 7, 2016 2:43 AM

All replies

  • Hi ayman,

    >> i want a code that check the birthday of a contact in my outlook contact list, then sending to all other contacts an informing email to inform that that contact's birthday is held.

    Which step do you have issues? For a complex request, I would suggest you spilt them into many threads, and ask one request in one thread. Do you have any issues about checking birthday of a contact. You could check the ContactItem.Birthday property.

    Here is a simple code:

    Sub getContact()
    Dim olConItems As Outlook.Items
    Dim olItem As Outlook.ContactItem
    Dim olApp As Outlook.Application
    Dim olFolder As Outlook.Folder
    Set olApp = Application
    Set olFolder = olApp.GetNamespace("MAPI").GetDefaultFolder(10)
    Set olConItems = olFolder.Items
    For Each olItem In olConItems
        If TypeName(olItem) = "ContactItem" Then
            If olItem.FirstName = "Test" Then
            Debug.Print olItem.Birthday
            End If
        End If
    Next olItem

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, April 7, 2016 2:43 AM
  • Thank you sir it help me a lot
    Tuesday, April 12, 2016 3:39 PM