Outlook Exchange Visual Basic Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Danielle Davis
    New Member
    • Oct 2011
    • 1

    #1

    Outlook Exchange Visual Basic Help

    I am using the below information to auto-forward my work emails to my BB via a gmail account. The script works fine.

    BUT my work email ask's for every email to send either classifield or unclassified.

    What and where would I add into the below script to autoforward UNCLASSIFIED???

    *I have written some VBA script to do this *bypass the server's disabling of auto-forward". Basically it mimics the user forwarding the email rather than the server doing an auto-forward. It's pretty simple:

    Sub AutoForwardAllS entItems(Item As Outlook.MailIte m)
    Dim strMsg As String
    Dim myFwd As Outlook.MailIte m
    Set myFwd = Item.Forward
    myFwd.Recipient s.Add "email@email.co m"
    myFwd.Send
    Set myFwd = Nothing
    End Sub
    It's beyond the scope of this post to give detailed instructions, but here's a summary: 1.Add the above code in the Visual Basic editor of Outlook (Alt-F11 should get your started). Be sure to change email@email.com to the address where you want the mail to go 2.Tell Outlook to run this code for each inbound message (Tools -> Rules and Alerts -> New Rule -> Check Messages when they arrive -> Next -> YES -> Checkbox "Run a Script" -> Then select the script you just created. Now Outlook should automatically forward each email you receive, but it won't be blocked by the Admin as an "Auto-forward".*

    Any suggestion's greatly appreciated :)
Working...