Outlook Automation

Is it possible to access detailed information (email, mobile, address,…) from a global address list from a exchange server in Navision Financials. In the automation object AddressEntry, only a few fields are available. KFA

Of course it’s possible. Try this (note: the ___ at the beginning of the line are necessary to simulate identiation which otherwise would be lost in this message). Create(Outlook); Namespace := Outlook.GetNamespace(‘MAPI’); MAPIFolder := Namespace.GetDefaultFolder(10); KontaktItem := MAPIFolder.Items; KontaktItem2 := KontaktItem.Restrict() //*** set filters here if necessary ***) IF KontaktItem2.Count <> 0 THEN BEGIN __FOR counter := 1 TO KontaktItem2.Count DO BEGIN ____OutlookKontakt := KontaktItem2.Item(counter); ____MESSAGE(OutlookKontakt.Title + ’ ’ +OutlookKontakt.LastName + ‘’ + ______OutlookKontakt.JobTitle+ ‘’ + ______OutlookKontakt.CompanyName + ‘’ + ______OutlookKontakt.BusinessTelephoneNumber) + ‘’ + ______OutlookKontakt.Email1Address); __END; END ELSE __ERROR(‘No contacts found’); Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Dear Fabian, Thanks for replying. The problem with this solution is that it reads the personal contact folder of my outlook. What I need is all de detailed information in the global address book. This address book can be read with The subtypes of the outlook automation server object AddressList and AddressEntry Example: CREATE(OUTL); MyNameSpace := OUTL.GetNamespace(‘MAPI’); MyGAddressLists := MyNameSpace.AddressLists(); MyGAddressList := MyGAddressLists.Item(3); MyGentries := MyGAddressList.AddressEntries; MyGentry := MyGentries.GetFirst; The problem with this solution is, that you can’t select E-mail, mobile etc…… If there is a solution to read this adressbook with the subtype contactItem, then my problem is solved

I see. In this case the question is where the global address list stores the e-mail address. According to your example … MyGentries := MyGAddressList.AddressEntries; … I would assume at first glance that it should be something like MyGentries.“e-mail address” but I suppose you have tried this already and didn’t find the e-mail address there, right? In fact, the AddressEntry (which is an element of AddressEntries) only defines links between two Items. Such as between you and your Boss. It doesn’t hold any useable data. I suggest you search for the file Vbaoutl9.chm, the “Microsoft Outlook Visual Basic Reference” which contains a very useful tree structure of all Outlook objects in chapter: “Microsoft Outlook Visual Basic Reference” → “Microsoft Outlook Objects”. Hope this helps Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch