L
larry
(sorry for cross posting - but this seems to span several areas and I
didn't find a perect fit in any news group)
I have a form on a web page on the intranet. One field is for entering
names and is automatically resolved to global address book (GAL) names
by using MAPI to resolve - see code below.
The problem is that the organisation here is going to migrate to
Office 2003 and that means that some office 2000 dll is being replaced
by a more "secure" office 2003 dll. This new dll now pops up a box
saying "A program is trying to access e-mail addresses ..... allow
access for 1 minute" when the names entered on the web page is being
resolved ..
This behaviour is going to be very annoying for the users and we need
another solution. I tried CDO - but that seems to rely on MAPI because
the same pop up appears. I also tried
createobject("outlook.application") , but that is now SO smart that it
tries to resolve the name in the to address field on the new mail
being created - and not displaying the "check names" from Outlook.
How can I resolve names without the "security" pop-up - any ideas ?
cheers
larry p
Function MAPIResolve(strName)' As String
On Error Resume Next
Dim oSession
Dim oFolder
Dim oMessages
Dim oMessage
Dim oRecipients
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", True, False, -1, True
Set oFolder = oSession.Inbox
Set oMessages = oFolder.Messages
Set oMessage = oMessages.Add
Set oRecipients = oMessage.Recipients.Add(strName)
oRecipients.Resolve
oMessage.Update
MAPIResolve = oMessage.Recipients(1)
Set oRecipients = Nothing
oMessage.Delete
Set oMessage = Nothing
Set oMessages = Nothing
Set oFolder = Nothing
oSession.Logoff
Set oSession = Nothing
end Function
didn't find a perect fit in any news group)
I have a form on a web page on the intranet. One field is for entering
names and is automatically resolved to global address book (GAL) names
by using MAPI to resolve - see code below.
The problem is that the organisation here is going to migrate to
Office 2003 and that means that some office 2000 dll is being replaced
by a more "secure" office 2003 dll. This new dll now pops up a box
saying "A program is trying to access e-mail addresses ..... allow
access for 1 minute" when the names entered on the web page is being
resolved ..
This behaviour is going to be very annoying for the users and we need
another solution. I tried CDO - but that seems to rely on MAPI because
the same pop up appears. I also tried
createobject("outlook.application") , but that is now SO smart that it
tries to resolve the name in the to address field on the new mail
being created - and not displaying the "check names" from Outlook.
How can I resolve names without the "security" pop-up - any ideas ?
cheers
larry p
Function MAPIResolve(strName)' As String
On Error Resume Next
Dim oSession
Dim oFolder
Dim oMessages
Dim oMessage
Dim oRecipients
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", True, False, -1, True
Set oFolder = oSession.Inbox
Set oMessages = oFolder.Messages
Set oMessage = oMessages.Add
Set oRecipients = oMessage.Recipients.Add(strName)
oRecipients.Resolve
oMessage.Update
MAPIResolve = oMessage.Recipients(1)
Set oRecipients = Nothing
oMessage.Delete
Set oMessage = Nothing
Set oMessages = Nothing
Set oFolder = Nothing
oSession.Logoff
Set oSession = Nothing
end Function