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

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.
Thread starter Similar threads Forum Replies Date
M Ignore slow add-ins Using Outlook 0
Diane Poremsky Testing please ignore New Slipstick.com Articles 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
U Outlook 2010 Ignore Conversation Feature, list of Active Ignored Using Outlook 1
R Ignore Conversation - does it just filter on subject line? Using Outlook 1
M Outlook 2007 - Any way to ignore 'On Behalf Of'? Using Outlook 3
L Watch/Ignore function__ Using Outlook 1
H Outlook 2007 spell check does not ignore original email message Using Outlook 1
H Outlook 2010: Conversation Clean Up and Ignore only functional in Cached Exchange mode? Using Outlook 1
L "Ignore orignial message text in reply or forward" not working - Outlook 2010 - Turning off original Using Outlook 1
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 New Slipstick.com Articles 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
C Outlook 2010 hyperlink blocked in Windows 7 Home Premium Using Outlook 2
C cannot access hyperlink in Outlook 2007 Using Outlook 1
J Hyperlink error in Outlook 2010 Using Outlook 2
P hyperlink no longer woking Using Outlook 2
D Error message when clicking on hyperlink within email: 'This operation has been canceled due to restrictions in effect on this computer...' Using Outlook 1
B How do I Insert a hyperlink (to company network) in an appointment in Outlook to distribute to attendees? Using Outlook 1
P unable to use hyperlink in outlook 10 Using Outlook 1
D Cannot open Hyperlink in outlook2010 Using Outlook 3
S Outlook 2007 will not show files under the folders any longer when creating a hyperlink. No error messages Using Outlook 1
E Hyperlink Problem in Outlook Using Outlook 2
E Opening a hyperlink Using Outlook 1
C Default folder Hyperlink outlook 2007 Using Outlook 2
Similar threads


















































Top