Trouble setting FileUnder using Redemption RDOMail object

C

Chris

Hi, I'm having trouble setting the FileUnder property of new Contact
items using Redemption's RDOMail object (version 4.0). The contacts
are properly created and show up in an Outlook public folder but their
FileAs is blank (no names visible in card view). Probably something
simple but I just can't seem to get it. Any thoughts?

Public Const CdoPropSetID3 = "0420060000000000C000000000000046"
Public Const CdoContact_FileUnder = "{" & CdoPropSetID3 & "}" &
"0x8005"
Public Const CdoContact_FileUnderID = "{" & CdoPropSetID3 & "}" &
"0x8006"
..
..
Dim c As RDOMail
..
..
c = contactsFolder.Items.Add("IPM.Contact")
..
..
c.Fields(.CdoPR_DISPLAY_NAME_PREFIX) = dr("Title").ToString
c.Fields(.CdoPR_TITLE) = dr("Function").ToString
c.Fields(.CdoPR_GIVEN_NAME) = dr("FirstName").ToString
c.Fields(.CdoPR_SURNAME) = dr("FamilyName").ToString
c.Fields(.CdoContact_EmailEmailAddress) = dr("Email").ToString
c.Fields(.CdoPR_DISPLAY_NAME) = dr("CalcFullNameInv").ToString
c.Fields(.CdoPR_COMPANY_NAME) = dr("Institution").ToString
c.Fields(.CdoPR_BUSINESS_TELEPHONE_NUMBER) = dr("Tel1").ToString

' Trouble with FileAs - the following doesn't work
c.Fields(.CdoContact_FileUnder) = "xxxx"
c.Fields(.CdoContact_FileUnderID) = 1

c.Save()
 
C

Chris

Thanks - still doesn't work for me. I probably don't understand how to
set these properties correctly. This is what I am trying, and in the
first three lines I am trying to set PR_SUBJECT

c.Subject = dr("CalcFullNameInv") ' Is this
PR_SUBJECT? (didn't work)
' c.Fields(&H37001E) = dr("CalcFullNameInv") '
PR_SUBJECT (didn't work)
' c.Fields("0x0037001E") = dr("CalcFullNameInv") '
PR_SUBJECT (didn't work)

' Trouble with FileAs - the following doesn't work
c.Fields(.CdoPR_DISPLAY_NAME) =
dr("CalcFullNameInv").ToString
c.Fields(.CdoContact_FileUnder) = "xxxx"
c.Fields(.CdoContact_FileUnderID) = 1

Thanks again.
 
C

Chris

Actually, I am having no problem setting PR_SUBJECT - if output
PR_SUBJECT it comes back just fine. But the FileUnder and FileUnderID
fields still don't stick. Here is my code:

c.Fields(.CdoPR_SUBJECT) = dr("CalcFullNameInv") ' this works
c.Fields(.CdoPR_DISPLAY_NAME) = dr("CalcFullNameInv").ToString ' this
works
c.Fields(.CdoContact_FileUnderID) = 32791 ' does not work
' c.Fields(.CdoContact_FileUnder) = .CdoPR_DISPLAY_NAME ' does not
work
c.Fields(.CdoContact_FileUnder) = dr("CalcFullNameInv").ToString ' does
not work

and here is some debug output of the fields of the newly created and
saved contact (note that FileUnder and FileUnderID don't stick):

Entry
000000001A447390AA6611CD9BC800AA002FC45A090012E9B35A80EFD311B5FE0020484001FE0000006C3A090000D1649D71540A5348A4C69BECF168FA6A000000A7940D0000
Full Name: Hysterical Comedian Samuel Johnson
Title: Hysterical Comedian
CdoPR_DISPLAY_NAME: Johnson, Mr Samuel
PR_Subject: Johnson, Mr Samuel
CdoContact_FileUnder:
CdoContact_FileUnderID: 0

Also, if I output FileUnder and FileUnderID for contacts which I
created in Outlook, their properties are returned just fine (so there
shouldn't be any problem with the constants or how I'm using the
contstants).

Any other suggestions? Thank you for your help.
 
D

Dmitry Streblechenko

If you create a contact in Outlook and then compare it with the contact
created by your code (click IMessage in OutlookSpy), do you see any extra
properties that contain the display name?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top