A
ataylorm
Good Morning,
I have a classic ASP page on an internal website that uses a VB6 DLL which
is downloaded to the client computer and access the MAPI components to select
contacts from their address book.
In other words I have a ASP page that sends a mass e-mail inside the company
and the user clicks a button which displays their outlook contact list, where
they select a distribution list, and that is returned to the page, which then
sends the e-mail.
The problem I have is that with Outlook 2007, MAPI isn't installed. We have
tens of thousands of PCs in three thousand locations around the world, and I
don't have the ability to control how they install Office 2007. That means I
need to find a way to make the DLL compatible until the site can be rewritten
next year.
My approach to this was to change the DLL to first try and use MAPI for
those still on outlook 2003, then if mapi couldn't be created, use the new
SelectNamesDialog to get the addresses from Outlook 2007. The problem is
that I can not get the SelectNamesDialog to work at all in VB6. I do have
the reference set for the Outlook 12 object. Here is the code I have, I am
getting error 287 application error:
Dim OutApp As New Outlook.Application
Dim oDialog As Outlook.SelectNamesDialog
Dim oAL As Outlook.AddressList
Dim oContacts As Outlook.Folder
Set oDialog = Outlook.Session.GetSelectNamesDialog
Set oContacts = OutApp.Session.GetDefaultFolder(olFolderContacts)
The Set oDialog = Outlook.Session.GetSelectNamesDialog is the line giving
me the trouble. I pulled this code from
http://msdn2.microsoft.com/en-us/library/bb176400.aspx
Any help with this would be VERY appreciated, I have been working on this
for nearly two weeks, and my boss is getting irritated.
I have a classic ASP page on an internal website that uses a VB6 DLL which
is downloaded to the client computer and access the MAPI components to select
contacts from their address book.
In other words I have a ASP page that sends a mass e-mail inside the company
and the user clicks a button which displays their outlook contact list, where
they select a distribution list, and that is returned to the page, which then
sends the e-mail.
The problem I have is that with Outlook 2007, MAPI isn't installed. We have
tens of thousands of PCs in three thousand locations around the world, and I
don't have the ability to control how they install Office 2007. That means I
need to find a way to make the DLL compatible until the site can be rewritten
next year.
My approach to this was to change the DLL to first try and use MAPI for
those still on outlook 2003, then if mapi couldn't be created, use the new
SelectNamesDialog to get the addresses from Outlook 2007. The problem is
that I can not get the SelectNamesDialog to work at all in VB6. I do have
the reference set for the Outlook 12 object. Here is the code I have, I am
getting error 287 application error:
Dim OutApp As New Outlook.Application
Dim oDialog As Outlook.SelectNamesDialog
Dim oAL As Outlook.AddressList
Dim oContacts As Outlook.Folder
Set oDialog = Outlook.Session.GetSelectNamesDialog
Set oContacts = OutApp.Session.GetDefaultFolder(olFolderContacts)
The Set oDialog = Outlook.Session.GetSelectNamesDialog is the line giving
me the trouble. I pulled this code from
http://msdn2.microsoft.com/en-us/library/bb176400.aspx
Any help with this would be VERY appreciated, I have been working on this
for nearly two weeks, and my boss is getting irritated.