|
 |
asp_cdo thread: Outlook "maybe virus" message
Message #1 by "Chaikin, Yaakov Y" <yaakov.y.chaikin@b...> on Thu, 07 Feb 2002 14:06:28 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1B00A.8C056590
Content-Type: text/plain
Hi!
I am programming an Addin for Outlook in VB with CDO.
On the Item_Send event, I am trying to do something very simple. However,
when CDO functions kick in the code, Outlook pops up a message:
"A program is trying to access your Outlook email addresses. It may be a
virus. Do you want to allow this?"
How do I get around this problem? Obviously, I don't want the users to see
this every time they send a message.
Here is the code:
Private Sub myOutlook_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim answer As Integer
Dim addressGAL As MAPI.AddressList
Dim addressEntries As MAPI.addressEntries
Dim addressEntry As MAPI.addressEntry
Dim addressFilter As MAPI.AddressEntryFilter
Set mySession = New MAPI.Session
mySession.Logon NewSession:=False
Set addressGAL = mySession.GetAddressList(CdoAddressListGAL)
Set addressEntries = addressGAL.addressEntries
Set addressFilter = addressEntries.Filter
addressFilter.Name = "Chaikin, Yaakov Y"
For Each addressEntry In addressEntries
MsgBox addressEntry.Name
MsgBox addressEntry.Fields(CdoPR_COUNTRY)
Next
answer = MsgBox("Are you sure you want to send this message?",
vbQuestion + vbYesNo, "Send Message?")
If (answer = vbNo) Then
Cancel = True
End If
mySession.Logoff
Set mySession = Nothing
End Sub
Yaakov Chaikin
Software Engineer
IT Department
BAE SYSTEMS
Voice: 301-838-6899
Fax: 301-838-6802
Yaakov.Y.Chaikin@b...
|
|
 |