Outlook Security Question

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi all,

I have "Redemption" installed and registered. Now how would I change this code to prevent the "A program is trying to access e-mail..." dialog box from appearing?

Public Sub StripAtt()

Dim objOL As Outlook.Application
Dim objMsg As Object
Dim objAttachments As Outlook.Attachments
Dim objSelection As Outlook.Selection
Dim i As Long
Dim lngCount As Long
Dim strFile As String
Dim strFolder As String
Dim Filename As String
On Error Resume Next

' Instantiate an Outlook Application object.
Set objOL = CreateObject("Outlook.Application")
' Get the collection of selected objects.
Set objSelection = objOL.ActiveExplorer.Selection


For Each objMsg In objSelection
' This code only strips attachments from mail items.
If objMsg.Class = olMail Then
' Get the Attachments collection of the item.
Set objAttachments = objMsg.Attachments
lngCount = objAttachments.Count
If lngCount > 0 Then
' We need to use a count down loop for
' removing items from a collection. Otherwise,
' the loop counter gets confused and only every
' other item is removed.
'Stop
For i = lngCount To 1 Step -1
' Save attachment before deleting from item.
' Get the file name.
strFile = objAttachments.Item(i).Filename

'The following line is the line which invokes the security message
Who = objMsg.SenderName

Next i

End If
objMsg.Save
End If
Next

ExitSub:
Set objAttachments = Nothing
Set objMsg = Nothing
Set objSelection = Nothing
Set objOL = Nothing
End Sub

Thanks in advance.

Jim
 
Please see my response to your earlier post on this issue.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi all,

I have "Redemption" installed and registered. Now how would I change this
code to prevent the "A program is trying to access e-mail..." dialog box
from appearing?


'The following line is the line which invokes the security message
Who = objMsg.SenderName
 
Hi Sue,

The last response showing to the other post is that I need to post the enitre message, so I did. But I still have no answers, only more questions.

Thanks anyway,

Jim
 
Sounds like you read only the first paragraph of the reply and not the
sample code.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi Sue,

The last response showing to the other post is that I need to post the
enitre message, so I did. But I still have no answers, only more questions.

Thanks anyway,

Jim
 
Hi Sue,

I did read more than the first paragraph, but somehow missed your sample code.

Thanks for the quick reply. I really appreaciate it.

Jim
 
I am new to this forum and could not find the sample coded referenced i
this thread.

Can you post it or send it to me?

Thanks,

Georg
 
Back
Top