Hi - first time here, so be gentle! I've been trying unsuccessfully for two days to display the SelectNamesDialog from Access, and I'm running out of Google links/variations to try. I've narrowed the cause down to a failure to instantiate the SelectNamesDialog object, but I can't find a reason for the failure. Using similar code from within Outlook works fine. I can create MailItems etc from Access fine. I've tried it with Outlook open in the background and closed. I have the same issue whether at work (on Windows 7, using MS Office 2010) or at home (Windows 7, MS Office 2007).
I've simplified the code for testing:
I receive a runtime error #287 (Application-defined or object-defined error). The program always stops on the lineSub ShowSND() Dim myOLApp As Outlook.Application Dim myNS As Outlook.NameSpace Dim mySND As Outlook.SelectNamesDialog Set myOLApp = CreateObject("Outlook.Application") Set myNS = myOLApp.GetNamespace("MAPI") Set mySND = myOLApp.Session.GetSelectNamesDialog End Sub, and the value of mySND remains "Nothing".Set mySND = myOLApp.Session.GetSelectNamesDialog
I'd appreciate any guidance on why this is happening. :-)
Thanks!