Group:  Microsoft Outlook ยป microsoft.public.outlook.program_vba
Thread: Bypass security popups when reading mail OL2003

Bypass security popups when reading mail OL2003
Ken 12/20/2008 7:36:01 PM
Hi-
I have a reader for my website email and it use to work when I had OL97
After upgrading to OL2003, I have constant security prompts for each mail
message. I'm not a power programmer. Can someone help?
Thanks
Ken

Code that reads in email messages and extracts info from them:
Sub ReadEmail_V1_1_Outlook97()
'Worked with outlook 97 cdo.dll 1.1, causes constant
'security popups with outlook 2003
Dim TmpRst As Recordset
Dim OlApp As Outlook.Application
Dim NS As Outlook.NameSpace
Dim Inbox As Outlook.MAPIFolder
Dim MI As Object
Dim Address, EnID, StID As String
'Dim Sess As MAPI.Session
'Dim ActMsg As MAPI.Message


Set DB = OpenDatabase("C:\My Documents\Ken1.mdb")

Set OlApp = New Outlook.Application
Set NS = OlApp.GetNamespace("mapi")
Set Inbox = NS.GetDefaultFolder(olFolderInbox)
'Set TmpRst = DB.OpenRecordset("Email")

For Each MI In Inbox.Items
With RS 'TmpRst

'Check for exact same email in DB
Sender = MI.SenderName '<---------------Causes security trap
EDate = MI.SentOn

'FindDupRecord

If Not EmailFound Then
.AddNew
!Sender = MI.SenderName

'Required to extract return email from outlook
' Set Sess = CreateObject("mapi.session")
' Sess.Logon "", "", False, False
' Set ActMsg = Sess.GetMessage(MI.EntryID, MI.Parent.StoreID)
!rtnemail = GetSenderAddress(MI)
'!rtnemail = Left$(ActMsg.Fields.Item(12).Value, 100)

!emaildate = MI.SentOn
!Subject = MI.Subject
!Body = MI.Body
.Update
End If
End With
Next

End Sub
Re: Bypass security popups when reading mail OL2003
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 12/20/2008 8:07:10 PM
See http://www.outlookcode.com/article.aspx?id=52

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Ken" <Ken[ at ]discussions.microsoft.com> wrote in message
news:9F86BBD8-12E7-410E-95ED-20B76D3DAFD5[ at ]microsoft.com...
[Quoted Text]
> Hi-
> I have a reader for my website email and it use to work when I had OL97
> After upgrading to OL2003, I have constant security prompts for each mail
> message. I'm not a power programmer. Can someone help?
> Thanks
> Ken
>
> Code that reads in email messages and extracts info from them:
> Sub ReadEmail_V1_1_Outlook97()
> 'Worked with outlook 97 cdo.dll 1.1, causes constant
> 'security popups with outlook 2003
> Dim TmpRst As Recordset
> Dim OlApp As Outlook.Application
> Dim NS As Outlook.NameSpace
> Dim Inbox As Outlook.MAPIFolder
> Dim MI As Object
> Dim Address, EnID, StID As String
> 'Dim Sess As MAPI.Session
> 'Dim ActMsg As MAPI.Message
>
>
> Set DB = OpenDatabase("C:\My Documents\Ken1.mdb")
>
> Set OlApp = New Outlook.Application
> Set NS = OlApp.GetNamespace("mapi")
> Set Inbox = NS.GetDefaultFolder(olFolderInbox)
> 'Set TmpRst = DB.OpenRecordset("Email")
>
> For Each MI In Inbox.Items
> With RS 'TmpRst
>
> 'Check for exact same email in DB
> Sender = MI.SenderName '<---------------Causes security trap
> EDate = MI.SentOn
>
> 'FindDupRecord
>
> If Not EmailFound Then
> .AddNew
> !Sender = MI.SenderName
>
> 'Required to extract return email from outlook
> ' Set Sess = CreateObject("mapi.session")
> ' Sess.Logon "", "", False, False
> ' Set ActMsg = Sess.GetMessage(MI.EntryID, MI.Parent.StoreID)
> !rtnemail = GetSenderAddress(MI)
> '!rtnemail = Left$(ActMsg.Fields.Item(12).Value, 100)
>
> !emaildate = MI.SentOn
> !Subject = MI.Subject
> !Body = MI.Body
> .Update
> End If
> End With
> Next
>
> End Sub


Re: Bypass security popups when reading mail OL2003
Ken 12/21/2008 7:22:00 AM
Thanks.
Is the an example of code that reads in messages and extracts info from them
without triggering the security popup? Im trying to do this without a 3rd
party program if possible.
Thanks



"Dmitry Streblechenko" wrote:

[Quoted Text]
> See http://www.outlookcode.com/article.aspx?id=52
>
> --
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
> -
> "Ken" <Ken[ at ]discussions.microsoft.com> wrote in message
> news:9F86BBD8-12E7-410E-95ED-20B76D3DAFD5[ at ]microsoft.com...
> > Hi-
> > I have a reader for my website email and it use to work when I had OL97
> > After upgrading to OL2003, I have constant security prompts for each mail
> > message. I'm not a power programmer. Can someone help?
> > Thanks
> > Ken
> >
> > Code that reads in email messages and extracts info from them:
> > Sub ReadEmail_V1_1_Outlook97()
> > 'Worked with outlook 97 cdo.dll 1.1, causes constant
> > 'security popups with outlook 2003
> > Dim TmpRst As Recordset
> > Dim OlApp As Outlook.Application
> > Dim NS As Outlook.NameSpace
> > Dim Inbox As Outlook.MAPIFolder
> > Dim MI As Object
> > Dim Address, EnID, StID As String
> > 'Dim Sess As MAPI.Session
> > 'Dim ActMsg As MAPI.Message
> >
> >
> > Set DB = OpenDatabase("C:\My Documents\Ken1.mdb")
> >
> > Set OlApp = New Outlook.Application
> > Set NS = OlApp.GetNamespace("mapi")
> > Set Inbox = NS.GetDefaultFolder(olFolderInbox)
> > 'Set TmpRst = DB.OpenRecordset("Email")
> >
> > For Each MI In Inbox.Items
> > With RS 'TmpRst
> >
> > 'Check for exact same email in DB
> > Sender = MI.SenderName '<---------------Causes security trap
> > EDate = MI.SentOn
> >
> > 'FindDupRecord
> >
> > If Not EmailFound Then
> > .AddNew
> > !Sender = MI.SenderName
> >
> > 'Required to extract return email from outlook
> > ' Set Sess = CreateObject("mapi.session")
> > ' Sess.Logon "", "", False, False
> > ' Set ActMsg = Sess.GetMessage(MI.EntryID, MI.Parent.StoreID)
> > !rtnemail = GetSenderAddress(MI)
> > '!rtnemail = Left$(ActMsg.Fields.Item(12).Value, 100)
> >
> > !emaildate = MI.SentOn
> > !Subject = MI.Subject
> > !Body = MI.Body
> > .Update
> > End If
> > End With
> > Next
> >
> > End Sub
>
>
>
Re: Bypass security popups when reading mail OL2003
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 12/22/2008 5:46:16 AM
Nope. SenderEmailAddress property is blocked. There is no way around that
using the Outlook Object Model or CDO 1.21.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Ken" <Ken[ at ]discussions.microsoft.com> wrote in message
news:30F5F4BE-03A9-44C5-AE06-7C1CF0D89065[ at ]microsoft.com...
[Quoted Text]
> Thanks.
> Is the an example of code that reads in messages and extracts info from
> them
> without triggering the security popup? Im trying to do this without a 3rd
> party program if possible.
> Thanks
>
>
>
> "Dmitry Streblechenko" wrote:
>
>> See http://www.outlookcode.com/article.aspx?id=52
>>
>> --
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>> -
>> "Ken" <Ken[ at ]discussions.microsoft.com> wrote in message
>> news:9F86BBD8-12E7-410E-95ED-20B76D3DAFD5[ at ]microsoft.com...
>> > Hi-
>> > I have a reader for my website email and it use to work when I had OL97
>> > After upgrading to OL2003, I have constant security prompts for each
>> > mail
>> > message. I'm not a power programmer. Can someone help?
>> > Thanks
>> > Ken
>> >
>> > Code that reads in email messages and extracts info from them:
>> > Sub ReadEmail_V1_1_Outlook97()
>> > 'Worked with outlook 97 cdo.dll 1.1, causes constant
>> > 'security popups with outlook 2003
>> > Dim TmpRst As Recordset
>> > Dim OlApp As Outlook.Application
>> > Dim NS As Outlook.NameSpace
>> > Dim Inbox As Outlook.MAPIFolder
>> > Dim MI As Object
>> > Dim Address, EnID, StID As String
>> > 'Dim Sess As MAPI.Session
>> > 'Dim ActMsg As MAPI.Message
>> >
>> >
>> > Set DB = OpenDatabase("C:\My Documents\Ken1.mdb")
>> >
>> > Set OlApp = New Outlook.Application
>> > Set NS = OlApp.GetNamespace("mapi")
>> > Set Inbox = NS.GetDefaultFolder(olFolderInbox)
>> > 'Set TmpRst = DB.OpenRecordset("Email")
>> >
>> > For Each MI In Inbox.Items
>> > With RS 'TmpRst
>> >
>> > 'Check for exact same email in DB
>> > Sender = MI.SenderName '<---------------Causes security trap
>> > EDate = MI.SentOn
>> >
>> > 'FindDupRecord
>> >
>> > If Not EmailFound Then
>> > .AddNew
>> > !Sender = MI.SenderName
>> >
>> > 'Required to extract return email from outlook
>> > ' Set Sess = CreateObject("mapi.session")
>> > ' Sess.Logon "", "", False, False
>> > ' Set ActMsg = Sess.GetMessage(MI.EntryID, MI.Parent.StoreID)
>> > !rtnemail = GetSenderAddress(MI)
>> > '!rtnemail = Left$(ActMsg.Fields.Item(12).Value, 100)
>> >
>> > !emaildate = MI.SentOn
>> > !Subject = MI.Subject
>> > !Body = MI.Body
>> > .Update
>> > End If
>> > End With
>> > Next
>> >
>> > End Sub
>>
>>
>>


Home | Search | Terms | Imprint
Newsgroups Reader