- #MICROSOFT WORD FIND AND REPLACE ADD NEW LINE HOW TO#
- #MICROSOFT WORD FIND AND REPLACE ADD NEW LINE MANUAL#
#MICROSOFT WORD FIND AND REPLACE ADD NEW LINE MANUAL#
However, there are times when Find and Replace can help you save time by applying formatting changes faster and easier than manual formatting. If you need to control what gets changed and what doesn’t more precisely, you might be better off going through your document and making those changes by hand. For example, if you need to change the color of all text or remove all instances of bold text in your document, you can do this by selecting all (Ctrl+A) and then applying the change you want. Sometimes, it makes sense to apply formatting changes manually. There are many ways to use Find and Replace for formatting, but when should you consider using Find and Replace instead of applying manual formatting changes or using other options like the Format Painter? When Is Finding and Replacing Formatting Useful? You can also use Find and Replace to locate specific types of formatting throughout your document and even replace that formatting with something else. Title = "PCI DSS - Credit Card Masking.Microsoft Word’s Find and Replace feature isn’t just for replacing text. If there are issues with the masking changes, do not save the file and consult the IT team." Check the results and save the file if the changes are correct. Msg = "The macro has masked " & Str$(Counter) & " credit cards. ' # Done masking PANs #Ĭounter = Counter / 2 ' because masks with a break were counted twiceĬounter = Counter – Preexisting ' New masks less previous mask-like data ' Visa and Mastercard - PAN broken up by. ' Visa and Mastercard - PAN broken up by spaces ' Visa and Mastercard - PAN broken up by. ' Visa and Mastercard - PAN broken up by : Execute(FindText:="xxxxxxxx", Forward:=True, Format:=True, _ Preexisting = Preexisting / 2 ' because masks with a break were counted twiceĭo While. Execute(FindText:="xxxx", Forward:=True, Format:=True, _ ' Count how many things already look like masked PANs so the final tally is correctĭo While. Msg = "The macro will now attempt to mask all the credit card numbers it can identify. ' Let the user know what's about to happenĭim Msg, Style, Title, Response, MyString ' This macro will search a document for numbers that look like Visa, MasterCard and AmEx credit card PANs and mask them with Xs
#MICROSOFT WORD FIND AND REPLACE ADD NEW LINE HOW TO#
I've had some luck with the below code, however it will identify and modify strings that are beyond the 16 characters for a standard credit card and I'm not sure how to stop the false-positives.
![microsoft word find and replace add new line microsoft word find and replace add new line](https://i.ytimg.com/vi/bUOuEakIWms/hqdefault.jpg)
Masking is a PCI DSS requirement, and there may be hundreds or thousands of documents to mask the data in. I figure a macro using regex to do a find and replace is the fastest way for them.
![microsoft word find and replace add new line microsoft word find and replace add new line](https://i.ytimg.com/vi/ISPRgB8hbeY/maxresdefault.jpg)
![microsoft word find and replace add new line microsoft word find and replace add new line](https://support.content.office.net/en-us/media/8a0d8867-0022-424e-858a-c0a29176ff8e.png)
I'm trying to allow our staff to quickly mask the middle 8 digits of credit card data in old documents.