Consulting

Results 1 to 4 of 4

Thread: Catch a word in Outlook subject

  1. #1
    VBAX Newbie
    Joined
    May 2010
    Posts
    2
    Location

    Catch a word in Outlook subject

    Our company has a method of converting our email to encrypted email when we put the word "Secure" in the subject line. Unfortunately, my department has begun using a transmission software called "Secure Transport". So any email that references the full name of the software gets encrypted, even though it does not contain sensitive information.

    After the first dozen times or so of this happening, I've managed to remember to abbreviate "Secure" to "Sec". But now that we're rolling the software out to clients and partners, they're initiating email to me with the full word in the subject, so when I reply to them, guess what, it gets encrypted. This is both annoying to them and embarrassing to me.

    I'm very conversant in Excel and Access vba, but Outlook not so much. Is there a way for Outlook to check the subject of an email before sending it for the presence of the word "secure" and allowing the user to cancel the send if the word is present? Thanks in advance.

    -Dave

  2. #2
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    The easiest way is to put code in the Outlook Application_ItemSend Event. At its most basic, something like this would do the trick:

    [VBA]If InStr(UCase(Item.Subject), "SECURE") Then
    If MsgBox("Mail will be encrypted. Continue?", vbYesNo) = vbNo Then Cancel = True
    End If[/VBA]
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  3. #3
    VBAX Newbie
    Joined
    May 2010
    Posts
    2
    Location
    That almost got it. I had to change the code to this:

    If InStr(UCase(Item.Subject), "SECURE") >0 Then
    If MsgBox("Mail will be encrypted. Continue?", vbYesNo) = vbNo Then Cancel = True
    End If

    Thanks!

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Well done! Not sure how that got missed when I posted it.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

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