M
Martin
Hi all,
Can someone help me with this code. I am trying to set the
CdoContact_FileUnder for a Contact but keep getting a type mismatch error on
" .Add CdoContact_FileUnder, CdoMessage.Subject"
Thanks.
Const CdoContact_FileUnder = "0x8005"
Const CdoPR_DISPLAY_NAME = &H3001001E
' On Error Resume Next
Set objMAPI = CreateObject("MAPI.Session")
objMAPI.Logon "", "", False, True, 0, True, "MAILSERVER" & vbLf &
"administrator"
Set objContFolder = objMAPI.GetDefaultFolder(5)
Set CdoMessages = objContFolder.Messages
Set CdoMessage = CdoMessages.Add
CdoMessage.Subject = "John Doe"
CdoMessage.Type = "IPM.Contact"
Set objFields = CdoMessage.Fields
With objFields
.Add CdoPR_DISPLAY_NAME, "John Doe"
.Add CdoContact_FileUnder, CdoMessage.Subject
' .Add CdoContact_FileUnderID, &HFFFFFFFF, CdoPropSetID3
End With
CdoMessage.Update True, True
Can someone help me with this code. I am trying to set the
CdoContact_FileUnder for a Contact but keep getting a type mismatch error on
" .Add CdoContact_FileUnder, CdoMessage.Subject"
Thanks.
Const CdoContact_FileUnder = "0x8005"
Const CdoPR_DISPLAY_NAME = &H3001001E
' On Error Resume Next
Set objMAPI = CreateObject("MAPI.Session")
objMAPI.Logon "", "", False, True, 0, True, "MAILSERVER" & vbLf &
"administrator"
Set objContFolder = objMAPI.GetDefaultFolder(5)
Set CdoMessages = objContFolder.Messages
Set CdoMessage = CdoMessages.Add
CdoMessage.Subject = "John Doe"
CdoMessage.Type = "IPM.Contact"
Set objFields = CdoMessage.Fields
With objFields
.Add CdoPR_DISPLAY_NAME, "John Doe"
.Add CdoContact_FileUnder, CdoMessage.Subject
' .Add CdoContact_FileUnderID, &HFFFFFFFF, CdoPropSetID3
End With
CdoMessage.Update True, True