Results 1 to 3 of 3

Thread: Script to auto-click "Allow" Outlook promt

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    3

    Script to auto-click "Allow" Outlook promt

    I am trying to automate the sending of an email through VB Script, but am receiving this message:



    I can get the script to activate the window via:
    Code:
    Set objShell = WScript.CreateObject("WScript.Shell")
    
    Do Until Success = True
        Success = objShell.AppActivate("Microsoft Office Outlook") 
        Loop
    I need a piece of code that will automatically click this "Allow" button. I can't really use sendkeys because this will be running while my PC is locked. My employer has my outlook locked down, so adjusting settings isn't an option. Any help would be great.
    Attached Images Attached Images  

  2. #2
    Lively Member
    Join Date
    Dec 2010
    Location
    http://bbat.forumeiro.com/
    Posts
    86

    Thumbs up Re: Script to auto-click "Allow" Outlook promt

    Hi Try using CDO like this example :
    PHP Code:
    Dim messageHTML
    Dim Previousday
    Dim FileAttach
    Dim ToAddress
    Dim CcAddress
    Dim MailSubject
    Previousday 
    Day(Date-1) & "_" Month(Date-1) & "_" Year(Date-1)
    messageHTML="Find in attachment, Report Day_" & (Previousday)
    'FileAttach = "D:\Report_Day_" & (Previousday) & ".xlsx"
    FromAddress = "Toto@mail.com"
    ToAddress = "me@address.com"
    '
    CcAddress "another@address.com"
    MailSubject "Report_Day_" & (Previousday)
    Set objMessage CreateObject("CDO.Message"
    objMessage.Subject MailSubject 
    objMessage
    .From FromAddress
    objMessage
    .To ToAddress
    'objMessage.CC = CcAddress
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.xxxx.com" '
    change THE SMTP SERVER to yours
    objMessage
    .Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
    objMessage
    .Configuration.Fields.Update
    'Ajout d'un message en HTML 
    objMessage
    .HTMLBody="<center><font size=4 FACE=Tahoma Color=red>"&messageHTML
    'objMessage.AddAttachment(FileAttach) 
    objMessage.Send
     If Err.Number <>0 Then
                MsgBox Err.Description,16,"Erreur"
                msgbox "The mail failed to delivery !",16,"Information"
            Else
            msgbox "The mail sent sucessfully !",64,"Information"
        End If 

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    3

    Re: Script to auto-click "Allow" Outlook promt

    Thanks for the reply. I've looked into doing it that way, but I would like to bypass that by simply creating a script to detect that pop message and click allow for me. I'm just havin a hard time finding the code to do that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width