+ Reply to Thread
Results 1 to 9 of 9

Creating message if Contact's birthday is today

  1. #1
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Creating message if Contact's birthday is today

    Hi,

    I found this piece of code on the web.

    http://help.lockergnome.com/office/C...ct1002097.html

    Its purpose is to send a short greeting to every contact if his/her Birthday falls within today.

    The problematic line is: BD = oCurItem.Birthday
    (I added it to see the birthday date by placing the curson on it)

    After 2-3 Loop cycles I get a 438 error: "...does not support this property" and BD shows: 01/01/4501

    What did I do wrong ?

    Please Login or Register  to view this content.
    Thanks,
    Elm

  2. #2
    Forum Administrator ExlGuru's Avatar
    Join Date
    03-17-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Creating message if Contact's birthday is today

    WScript is unknown. Replace WSCript.Echo by MsgBox.

    It the code runs within Outlook then delete the Set ol = New ... line, and
    replace ol.GetNameSpace by Application.GetNamespace.

    You do not set any date to the today variable, so the value is 0. The Date
    function would return the current date.

    If you want one message be displayed if there's no birthday today at all
    then use another variable declared As Boolean. If one birthday is found then
    set it = True. Eventually, if the variable is still False (inital value)
    then you know that it never was set to True, i.e. no birthday.
    ExlGuru

  3. #3
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Creating message if Contact's birthday is today

    Hi,

    This is a very nice "copying job" of Michael Bauers reply at the site where I found the code.

    If you'll look a little bit closer you'll probably see that I "obeyed" all proposed instructions but, as said before, it still "does not supply the merchandise".

    Could you check the code on your computer to see how it acts there.
    If any additional modification is needed - I will appreciate if you'll take care of them.

    Any other VBA code providing the requested task (NO third-party software) will be appreciated.

    Thanks, Elm

  4. #4
    Forum Administrator ExlGuru's Avatar
    Join Date
    03-17-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Creating message if Contact's birthday is today

    Elmers it was mistakenly send to you it was not actually for you, that is the solution for L_ter's Question.So please don't be worry.I m trying to find out the solution for you.

    Thanks.

  5. #5
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Creating message if Contact's birthday is today

    Thanks, ExlGuru

    I'll wait "Impatiently" for a decent result...

    Elm

  6. #6
    Forum Administrator ExlGuru's Avatar
    Join Date
    03-17-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Creating message if Contact's birthday is today

    By this code you are able to set the remainder .You have to set a remainder to the outlook.

    Elmers try this code:

    Hope it helps:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Creating message if Contact's birthday is today

    Sotty, but now I lost you completely and could not find my way through your last codes.

    My request goes like that:

    When I manually, add/mark a contacts birthday - it becomes an Annually Recurrent Event with a reminder.

    So far so good.

    What I need is a code that will open/display a new mail message with some pre-defined blessing.

    I will press send after examining the 'to-be sent' message.
    [If there are 3 contacts whose Birthday falls on the same date - 3 new messages will be generated and opened - each for every contact.

    That is all I need.

    Thanks, Elm

  8. #8
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Creating message if Contact's birthday is today

    I believe you'd be getting the error you're getting if the contact being processed is not an individual contact, but perhaps a distribution list, which does not have a Birthday property.

    Try inserting a test to confirm that the contact being processed is a "Contact", with something like this:

    Please Login or Register  to view this content.

    Or, trap the error when you query the birthday property and it doesn't work.

  9. #9
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Creating message if Contact's birthday is today

    Hi,

    Thanks to all who repliers up to now.

    Here is the code I came up with/

    Please note the two command which provide a "run-time error 424" if one, or, more recipients have Birthday - today..

    Where did I go wrong and what can be done to correct it !?

    Thanks, Elm

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1