Thanks for the reply. I’ve read about tokens but I still can’t figure how to solve my problem which is:
I have a list of words, I need to search the bodytext for that strings and when I find them I need to make them bold.
I was thinking to parse the bodytext with the PosWordRight and SelectRightWord and when I find the words from my dictionary, make them bold. My problem is how do I know when PosWordRight arrives to the end of the message and how do I know who is the selected word. For the last issue I’ve tried the EnvTextCurrentWord token, but it returns only on letter, not the word.
Other idea i had is to use the Find token, but using this is a little complicated, because I will need to use find for all the word, and if I have a big dictionary of words it will take too long. And I didn’t managed to make the findnext token to work properly. It pop-ups me the find dialog, not selecting the next occurrence from find
The code below access message body, set bold to some of the words.
dim oList
dim oDocument
dim x
dim text
dim innerHtml
dim handle
' List of word to modify
set oList = utilities.stringlist
oList.add("Hello")
oList.add("World")
oList.add("Regards")
set oDocument = nothing
' Get the message handle
handle = Utilities.FindWindow("OFMailView", "")
' Get an instance of the IHTMLDocument interface
if Utilities.IHTMLDocumentFromViewHandle(handle, oDocument) = 0 then
innerHtml = oDocument.body.innerHtml
for x = 0 to oList.Count - 1
text = oList.Strings(x)
innerHtml = utilities.FastReplace(innerHtml, text, "<b>" & text & "</b>", false)
next
oDocument.body.innerHtml = innerHtml
end if
set oList = nothing
set oDocument = nothing