Ignore hyperlink from being flagged as false pattern

Status
Not open for further replies.

LockonZero

Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
I have a script that checks my outgoing email for any credit card number that are unmasked. However, if an embedded hyperlink coincidentally have the same format with the credit cards format that I am trying to filter, it flags it down and prevents me from sending the email. I want it to be able to determine if the pattern is within a hyperlink or not and perform its check before sending the email. Can someone advice on how I go about this? Am just a newbie with outlook vba so any help will be much appreciated. I'm attaching my script here.
 

Attachments

  • check.txt
    2.3 KB · Views: 185

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You could check the character before and after the found code - if its not an EOL, space, or period, its more likely a url. You can do it using regex, not sure you can do it using like.

You could try adding a space after the last number in the array - but that only works if it is in the middle of a sentence but could cut down on the number of false alarms. I would probably do another IF statement if there is a match to the number string - the second one will check for a space before or after (4 in the array).
 

LockonZero

Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Thanks for the tip Diane. Will try your suggestion.
 

LockonZero

Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
You could check the character before and after the found code - if its not an EOL, space, or period, its more likely a url. You can do it using regex, not sure you can do it using like.

You could try adding a space after the last number in the array - but that only works if it is in the middle of a sentence but could cut down on the number of false alarms. I would probably do another IF statement if there is a match to the number string - the second one will check for a space before or after (4 in the array).


Hi Dianne,

I've changed the pattern checking using regex instead of like and have something like this and is working.


With Reg1
.pattern = "(\d{16}|\d{4}-\d{4}-\d{4}-\d{4}|\d{4}.\d{4}.\d{4}.\d{4}|\d{4} \d{4} \d{4} \d{4})"
.Global = True
End With

However, I did find that if there is a pattern that matches 16 digits and there are other subsequent digits, it still flags instead of allowing it to be sent. sample is 11112222333344445555.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Ignore slow add-ins Using Outlook 0
Diane Poremsky Testing please ignore Using Outlook 1
S Creating custom rule to move if "NAME" is in body but ignore the phrase "Hi NAME" in the search Using Outlook 2
X Can you get outlook to ignore certain weeks for recurring meetings? Using Outlook 1
V Embedding hyperlink into Word document Using Outlook 2
Y Open and Save Hyperlink Files in multiple emails Outlook VBA and Custom Forms 9
D Custom form with html hyperlink Outlook VBA and Custom Forms 7
N open the hyperlink in Outlook directly instead of browser Using Outlook 1
M VBA Rule for removing all body but hyperlink then forwarding Outlook VBA and Custom Forms 9
M How to view the URL for a hyperlink? Using Outlook 1
A Add Hyperlink to Task Outlook VBA and Custom Forms 11
Q Why can't I copy image with embedded hyperlink from email to Word Using Outlook 0
P URL Hyperlink not working correctly in Outlook 2003 Using Outlook 10
A Create Macro for hyperlink(email) in message body Outlook VBA and Custom Forms 9
Diane Poremsky Disable the Unsafe Hyperlink Warning when Opening Attachments Using Outlook 0
V Using custom field data in mail body + mailto hyperlink Outlook VBA and Custom Forms 7
C Hyperlink to an Outlook search Using Outlook 1
makinmyway Recent Files Not Updating when Using Insert Hyperlink in Outlook 2013 Using Outlook 0
E Create a URL hyperlink in an Outlook custom form? Outlook VBA and Custom Forms 2
J Macro generating email using default signature and hyperlink Outlook VBA and Custom Forms 5
witzker HYPERLINK "mailto:test@test.com" in form body Using Outlook 21
Hudas Hyperlink Saved Outlook Email to MS Access Table Using Outlook 4
D Particular Facebook "Hyperlink" Issue In Office 2010 Outlook (32 bit) Using Outlook 5
S email body without "HYPERLINK" ( vba ) Using Outlook 6
M How to create a hyperlink to to an organizational form Using Outlook 5
J Hyperlink VBA Using Outlook 1
P Can't add a custom hyperlink to toolbar in OL 2010 Using Outlook 1
T Desable Hyperlink on email Using Outlook 3
O Hyperlink formatting lost after replacement in outlook Using Outlook 5
O Hyperlink formatting lost after replacement in outlook Using Outlook 0
G Hyperlink Using Outlook 1
T Hyperlink Issue Using Outlook 2
P Hyperlink to Access record/Form Outlook VBA and Custom Forms 2
M auto click hyperlink?! Outlook VBA and Custom Forms 1
M Auto click a hyperlink Outlook VBA and Custom Forms 2
R Inserting a hyperlink in the bod of an outlook appt. Outlook VBA and Custom Forms 13
K Add Hyperlink in Email Body by VBA Outlook VBA and Custom Forms 1
K Multiple copies of task being created Using Outlook 2
F Email being marked as Spam by Gmail and not being visible in Outlook Using Outlook 5
C Outlook 2016/2019 hangs after being open for an extended period Using Outlook 4
GregS 2016 Contact List being managed by Outlook.com? Using Outlook 1
B Outlook - Mail from safe senders list being sent to Spam Folder Using Outlook 0
P Reminders Window stops being displayed, even with /resetfolders or /cleanreminders Using Outlook 8
A Replies being sent from wrong account Using Outlook 8
N Tracking Mail items being moved to folders Outlook VBA and Custom Forms 5
T Compacting Outlook 2010 OST results in old emails being re-sent Using Outlook 6
S Bullets Being Changed to Rectangles Using Outlook 15
M Emails being sent to Inbox and IPM_Subtree Using Outlook.com accounts in Outlook 4
Diane Poremsky Help! My Contacts are being updated! Using Outlook 0
M Upgrade in Progress. Your mailbox is currently being optimized as part of upgrade to Outlook 2010 Using Outlook 9

Similar threads

Top