Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I cannot seem to be able to access/dispay the content of a user defined field on an Outlook contact form from within Excel VBA. Any thoughts very much appreciated! Here is the code: Sub Open_Outlook() Dim MyProperty As Object Dim MyFolder2 As Outlook.MAPIFolder ' Creates path to Outlook and to the Landlords Properties folder Set ol = New Outlook.Application Set olns = ol.GetNamespace("MAPI") Set MyFolder1 = olns.GetDefaultFolder(olFolderContacts) Set MyFolder2 = MyFolder1.Folders("Properties") Set MyProperties = MyFolder2.Items Set MyProperty = MyProperties.Find("[FullName] = ""D101""") If MyProperty Is Nothing Then ' Find failed MsgBox "Property Reference not found" Else MsgBox MyProperty.FullName MsgBox MyProperty.UserProperties("LLsurname") ' This is the problem!! End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You can download my addin Outlook2Excel from http://members.chello.nl/keepitcool/download.html It's unprotected so you can review the code. Heck you might even like it and use it :) Note that you should swap the interface language by clicking the "empty" button on the taskbar! Be aware that outlook 9 and 10 are different with respect to the userproperties. (Review Object Explorer/and or Help) keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Richard Naish" wrote: Hi, I cannot seem to be able to access/dispay the content of a user defined field on an Outlook contact form from within Excel VBA. Any thoughts very much appreciated! Here is the code: Sub Open_Outlook() Dim MyProperty As Object Dim MyFolder2 As Outlook.MAPIFolder ' Creates path to Outlook and to the Landlords Properties folder Set ol = New Outlook.Application Set olns = ol.GetNamespace("MAPI") Set MyFolder1 = olns.GetDefaultFolder(olFolderContacts) Set MyFolder2 = MyFolder1.Folders("Properties") Set MyProperties = MyFolder2.Items Set MyProperty = MyProperties.Find("[FullName] = ""D101""") If MyProperty Is Nothing Then ' Find failed MsgBox "Property Reference not found" Else MsgBox MyProperty.FullName MsgBox MyProperty.UserProperties("LLsurname") ' This is the problem!! End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
does Excel 07 allow User Defined functions? | Excel Worksheet Functions | |||
Excel Message "user defined type not defined" | Excel Discussion (Misc queries) | |||
Excel user defined functioned | Excel Worksheet Functions | |||
"User-defined type not defined" message in Excel | Excel Discussion (Misc queries) | |||
Excel user defined functions. | Excel Worksheet Functions |