Reminder Field problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm a newbie to all of this, so please bear w/ me...

I'm trying to add a field to contact records that is exactly like the Anniversary or Birthday fields (will show up on my calendar) but need a reminder 30 days out. Can anyone please explain how to do this? I can add the fields OK, but can't seem to get a reminder to trigger

thanks
 
Not so easy. You need to add code to your form to be able to set a reminder
for a contact item and contact items don't expose the reminder settings to
the Outlook object model. You would need to use CDO 1.21 (optional
installation with Outlook 2000 and later) or Redemption
(www.dimastr.com/redemption) to be able to do what you want.

The field for ReminderSet for a contact item is:
Message.Fields("{0820060000000000C000000000000046}0x8503")

ReminderTime is:
Message.Fields("{0820060000000000C000000000000046}0x8502")

And FlagDueBy is:
Message.Fields("{0820060000000000C000000000000046}0x8560")

You would need to set ReminderSet = True and the other 2 properties to the
same date/time value which would be the time you wanted the reminder to be
set.

Using CDO code in the form here's what it would look like in the Sub where
you would add the reminder:

Sub AddReminder()
Dim oSession
Dim oMessage
Dim oField
Dim datDate

Const vbDate = 7
Const vbBoolean = 11

On Error Resume Next

datDate = DateAdd("d", 30, Now)

Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False

'this line will only work if the item has already been saved so it has
an EntryID
Set oMessage = oSession.GetItem(Item.EntryID, Item.Parent.StoreID)

'now the meat
Set oField = oMessage. _
Fields("{0820060000000000C000000000000046}0x8503")
If Err Then
Set oField = oMessage.Fields. _
Add("{0820060000000000C000000000000046}0x8503", _
vbBoolean, True)
Else
oField = True
End If

Set oField = oMessage. _
Fields("{0820060000000000C000000000000046}0x8502")
If Err Then
Set oField = oMessage.Fields. _
Add("{0820060000000000C000000000000046}0x8502", _
vbDate, datDate)
Else
oField = datDate
End If

Set oField = oMessage. _
Fields("{0820060000000000C000000000000046}0x8560")
If Err Then
Set oField = oMessage.Fields. _
Add("{0820060000000000C000000000000046}0x8560", _
vbDate, datDate)
Else
oField = datDate
End If

oMessage.Update

'set all objects = Nothing here
End Sub




SpartanG said:
Hi-

I'm a newbie to all of this, so please bear w/ me....

I'm trying to add a field to contact records that is exactly like the
Anniversary or Birthday fields (will show up on my calendar) but need a
reminder 30 days out. Can anyone please explain how to do this? I can add
the fields OK, but can't seem to get a reminder to trigger.
 
The other approach is to put code behind your form to create an event in the
Calendar folder corresponding to your date and set the reminder on that
event.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



SpartanG said:
Hi-

I'm a newbie to all of this, so please bear w/ me....

I'm trying to add a field to contact records that is exactly like the
Anniversary or Birthday fields (will show up on my calendar) but need a
reminder 30 days out. Can anyone please explain how to do this? I can add
the fields OK, but can't seem to get a reminder to trigger.
 
Back
Top