Highlight duplicate text in block of text

@KamilLanda
Roznama Duplicate Case Number.odt (64.8 KB)
one more idea come in my mind.

In the attached file there are separate blocks which begin from IN THE COURT OF and end with ------------------------------------------------------------------------------------------------------------------------
We have to take printout of the file and cut the file from dashed lines. Then we have to paste it on cases. There are different Case No.: which are categorised as Category / Number / Year. Many times it happens that on the same day there used to be cases of Different Category but same number or different year but same number. Our peons used to paste the block of one category to another. For example, if there is Case No. S.C.C. / 167 / 2020 and R.C.C. / 167 / 2020. OR there is case of SCC / 167 /2020 and SCC / 167 /2021, by mistake the block of one case used to be paste on another case. Therefore I wish that if there are duplicate Category / Case Number or duplicate Case Number / Year on the same day that should be highlighted in the printing.

Criterion is Case Number, macro set BackgroundColor to yellow for the lines that have the same Case Numbers (if the line isn’t in Table). You can change the highlighting in Sub highlight.
highlight-line.odt (64.1 kB)

1 Like

It is working but in black printout the yellow highligting is not printing. So make the text to white and highliting to black.

Sub highlight(oDoc as object, oPos as object, oVCur as object) 'highligh the line that has the block with the position oPos
	with oVCur
		.gotoRange(oPos, false)
		.gotoStartOfLine(false)
		.goToEndOfLine(true)
		.CharBackColor=rgb(50, 50, 50) 'or (0, 0, 0) to standard black background
		.CharColor=rgb(255, 255, 255) 'white
	end with	
End Sub
1 Like