Add new phone log problem

S

sasqlacz

On incomming call i search bussines contact connected with phone number and I
display searched contact. Next I create new phone log connected with this
business contact save it and display to user. The problem is that phone log
form displays with most of field read only. Second issue is that form han an
icon like journal item but all form looks like phone log form BCM.
Interesting thing is that saved phone log is properly displayed in 'History'
tab on business contact form.

I use this code to create new phone log item.

private void AddPhoneLogEntryForBcmContact(MSOutlook.ContactItem contact)
{
MSOutlook.MAPIFolder bcmFolder =
this.Application.GetNamespace("MAPI").Folders["Business Contact Manager"];
MSOutlook.MAPIFolder historyFolder =
bcmFolder.Folders["Communication history"];

MSOutlook.JournalItem journalItem =
(MSOutlook.JournalItem)historyFolder.Items.Add("IPM.Activity.BCM.PhoneCall");
journalItem.Type = "Phone Log";
journalItem.Subject = "Incoming call";

if (null == journalItem.UserProperties["Parent Entity EntryID"])
{
MSOutlook.UserProperty userProp =
journalItem.UserProperties.Add("Parent Entity EntryID",
MSOutlook.OlUserPropertyType.olText, false, false);
userProp.Value = contact.EntryID;
}
journalItem.Save();
journalItem.Display(false);
}

I use VS2005 VSTO Add-in, Office 2007, BCM version 3.00.5828.
Any help would be apriciated.
 
S

sasqlacz

I've solved problem. In two points the code was wrong:

1. Type "IPM.Activity.BCM.PhoneCall" have to be replaced by
"IPM.Activity.BCM.PhoneLogCall". It looks like MSDN has a mistake in a topic
http://msdn2.microsoft.com/en-us/library/aa431973.aspx.

2. Extra user property initialization have to be done. I don't know english
name of the user propertie, because I found it out using OutlookSpy in
localized Outlook version. The name of the user propertie could be
'Identifier of parent position' or something like that.
 

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