A
ABM
I am using the following code on an Access form to determine if an account
code exists in a Personal Address book and to display the Outlook details
form. I have downloaded Redemption in an attempt to stop the security alerts
but can't figure out exactly how to change this code using Redemption objects
in order to stop the alerts. Any help would be appreciated.
Dim oSession As MAPI.Session
Dim oAddressEntry As MAPI.AddressEntry
Dim oAddressEntries As MAPI.AddressEntries
Dim oAddressList As MAPI.AddressList
Dim sAccount As String
Dim bFound As Boolean
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False
Set oAddressList = oSession.AddressLists.Item("Personal Address Book")
Set oAddressEntries = oAddressList.AddressEntries
sAccount = Me.Account
For Each oAddressEntry In oAddressList.AddressEntries
If oAddressEntry.Name = sAccount Then
bFound = True
Exit For
End If
Next
If bFound Then
oAddressEntry.Details
Else
MsgBox sAccount & " not in Personal Address Book.", vbOKOnly +
vbExclamation, "EMail"
End If
Exit_Sub:
oSession.LogOff
Set oSession = Nothing
Set oAddressEntry = Nothing
Set oAddressEntries = Nothing
Set oAddressList = Nothing
code exists in a Personal Address book and to display the Outlook details
form. I have downloaded Redemption in an attempt to stop the security alerts
but can't figure out exactly how to change this code using Redemption objects
in order to stop the alerts. Any help would be appreciated.
Dim oSession As MAPI.Session
Dim oAddressEntry As MAPI.AddressEntry
Dim oAddressEntries As MAPI.AddressEntries
Dim oAddressList As MAPI.AddressList
Dim sAccount As String
Dim bFound As Boolean
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False
Set oAddressList = oSession.AddressLists.Item("Personal Address Book")
Set oAddressEntries = oAddressList.AddressEntries
sAccount = Me.Account
For Each oAddressEntry In oAddressList.AddressEntries
If oAddressEntry.Name = sAccount Then
bFound = True
Exit For
End If
Next
If bFound Then
oAddressEntry.Details
Else
MsgBox sAccount & " not in Personal Address Book.", vbOKOnly +
vbExclamation, "EMail"
End If
Exit_Sub:
oSession.LogOff
Set oSession = Nothing
Set oAddressEntry = Nothing
Set oAddressEntries = Nothing
Set oAddressList = Nothing