Migration from CDO 1.2 to OOM2007: field/property handling???

  • Thread starter Thread starter Benedikt
  • Start date Start date
B

Benedikt

Hi, I have to migrate an existing application (VB6) to Outlook 2007.
Currently, it uses CDO 1.21. From now on OOM 2007 is to be used. The essence
of the code:

Const MSG_CLASS_TASK As String = "IPM.Task"
Const CdoPropSetID2 As String = "0320060000000000C000000000000046"
Const CdoTask_Status As String = "0x8101"
Const CdoTask_StartDate = "0x8104"
Const CdoTask_DueDate = "0x8105"

Dim objMsg As MAPI.Message

With objMsg
Dim sTel As String
sTel = .Fields.Item("MRSNP_CTI_NUMBER")

Dim StartDate As Date
Dim StartDateStr As String
Dim StartTimeStr As String
Call .Fields.Add(CdoTask_StartDate, CdoFieldType.CdoDate, StartDateStr,
CdoPropSetID2)
Call .Fields.Add(CdoTask_DueDate, CdoFieldType.CdoDate, StartDateStr,
CdoPropSetID2)
Call .Fields.Add(CdoTask_Status, CdoFieldType.CdoLong, 0&, CdoPropSetID2)

.Type = MSG_CLASS_TASK

Dim sTelnumber As String
Call .Fields.Add("SPOData", CdoFieldType.CdoString, sTelnumber,
CdoPropSetID2)

.Update True
Call .MoveTo(DestFolderID)
End With

How would the field/property handling look like in OOM 2007? I assume that I
have to use the PropertyAccessor. But I have problems regarding how to pass
him all necessary parameters - especially how to convert the CDO constants to
the OOM world. For example, I've examined a task item with OutlookSpy but the
GUID of the StartDate property is {00062003-0000-0000-C000-000000000046}
instead of the known CdoPropSetID2 "0320060000000000C000000000000046"...

Is there somewhere a documentation on how to migrate CDO to OOM?

Please help. Regards. Benedikt
 
There's no migration information that I've ever seen for CDO to OOM 2007.

CDO uses a really hacked version of the MAPI GUID for a namespace, in
reality both "0320060000000000C000000000000046" and "
{00062003-0000-0000-C000-000000000046}" refer to the same namespace in
Outlook/MAPI.

For example, for taskItem.Status you would use this in the OOM:

"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003"

The GUID is used after the "/mapi/id/" part and followed by a concatenation
of the ID value (0x8101) and the property type, in this case PT_LONG
(0x0003) as strings.

If you use OutlookSpy the easiest thing to do is to look at the DASL field
or fields for a selected property. That is the string you should use with
PropertyAccessor.

For information about how CDO converts the MAPI GUID to a CDO GUID see
http://support.microsoft.com/kb/195656.
 
Back
Top