2)Blacklist option not required - Does not fit my requirment to search from a list of 1500 words
In need of macro for open office writer as simlar to below macro for microsoft word,
This macro for word document searches all the words that will be listed in another document.
Steps
1.put all words you want to search in one document, phrase should occupy one paragraph
2.Now there is a box. Enter the path and name of the list document you just saved. Then click “OK”
3.The next thing you see is all found words are in highlighting.
Macros for Microsoft word as beleow, Need code of such for openoffice writer.
Code: Select all
Sub FindMultiItemsInDoc()
Dim objListDoc As Document
Dim objTargetDoc As Document
Dim objParaRange As Range, objFoundRange As Range
Dim objParagraph As Paragraph
Dim strFileName As String
strFileName = InputBox("Enter the full name of the list document here:")
Set objTargetDoc = ActiveDocument
Set objListDoc = Documents.Open(strFileName)
objTargetDoc.Activate
For Each objParagraph In objListDoc.Paragraphs
Set objParaRange = objParagraph.Range
objParaRange.End = objParaRange.End - 1
With Selection
.HomeKey Unit:=wdStory
' Find target items.
With Selection.Find
.ClearFormatting
.Text = objParaRange
.MatchWholeWord = True
.MatchCase = False
.Execute
End With
' Highlight the found items.
Do While .Find.Found
Set objFoundRange = Selection.Range
objFoundRange.HighlightColorIndex = wdBrightGreen
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Next objParagraph
End Sub