Automation Problem

I created a codeunit that automates Outlook contacts and push customer/vendors records that the user selects out to OutLook. The problem that i ran into is that they are modifing contacts that were already created and Outlook is not modifing that contact record, but creating a new Outlook contact. Does anyone have any ideas regarding this? Maybe how to find a Outlook contact and modify it the Navison record has changed? CAN SOMEONE HELP ME CONVERT THIS TO C/SIDE… Set myOlApp = CreateObject(“Outlook.Application”) Set myNameSpace = myOlApp.GetNameSpace(“MAPI”) Set myContacts = myNameSpace.GetDefaultFolder (olFolderContacts) Set myItem = myContacts.Items.Find("[FileAs] = _ ““Jones”” and [FirstName] = ““Brent””") This is the search funstion I wrote in VB. I need help converting this into something Navision can understand.

I have just completed a similar piece of work using VB to communicate with Navision via CFRONT and ODBC ( To Sql 7) in my case . I used the Remote Data Objects method in VB (rdo) which allows the creation of a sepcific Dynaset (cursor) via an SQL query from ODBC. In this way the specific data record can be modified or created depending upon your test on the odbc CALL result. The VB code is Verbose to write but the execution is quite efficient Pleas Email me if you would like some VB code samples

I’m doing almost the same thing - trying to update contacts as fields are modified in Navision. I’m using a somewhat different approach, using EntryIDs as opposed to the FIND command. This makes sure you’re accessing the exact Outlook Item. What I do is when I write the Item to Outlook, I have Outlook return the unique entry id to Navision and I write it to a new field in my Navision table. Then I use that ID when I have to access the record from Outlook to modify later. Code I’m using to write ID to Navision: ContactItem := OLApp.CreateItem(2); ContactItem.LastName(“Last Name”); ContactItem.FirstName(“First Name”); ContactItem.Save; NaviEntryID := ContactItem.EntryID; MODIFY; ContactItem.Close(0); Code to use ID to get record from Navision: ContactItem := OLNameSpace.GetItemFromID(NaviEntryID); I hope this helps. Robert M. Nelson Parente Technology