Suppress dialog warning that a program is trying to access my mails

后端 未结 3 2011
半阙折子戏
半阙折子戏 2020-12-20 01:52

I am following the code from this page: How to create a script for the Rules Wizard in Outlook

This is what I have:

Public Sub GetMails(Item As Outlo         


        
相关标签:
3条回答
  • 2020-12-20 02:31

    Try this

    Tools-->Macro-->Security-->macro security-->No security Tools-->Macro-->Security-->Programmatic Access

    Then choose Never warn me about suspicious activity.

    0 讨论(0)
  • 2020-12-20 02:46

    I found this somewhere and it works:

    Sub SaveAttachment(myItem As Outlook.MailItem)
    

    ' Remove ay attachments for the email and save them in a ' local folder. If there are any erros on the saveing then ' attachments are left in place.

    Dim myAttachments As Object
    Dim myOrt As String
    Dim strID As String
    Dim olNS As Outlook.NameSpace
    Dim oMail As Outlook.MailItem
    Dim fs As Object
    

    ' We need to get the mail item object from the application ' object to avoid warning messages

    strID = myItem.EntryID
    Set olNS = Application.GetNamespace("MAPI")
    Set oMail = olNS.GetItemFromID(strID)
    
    0 讨论(0)
  • 2020-12-20 02:53

    This was added to prevent malicious scripts from turning Outlook into a mass mailer or other bad things.

    You can turn this off on your workstation, but if you want to distribute your application to other users, you can get rid of this only by creating your own Outlook Addin or use a 3rd-party tool like Redemption.

    0 讨论(0)
提交回复
热议问题