AppleScript find and highlight in MS Word
Hi everyone, I'm new to scripting and struggling to below script:
set docPath to "/path/to/file"
tell application "Microsoft Word"
set doc to open docPath
set doc to the active document
set myfind to find object of text object of doc
set properties of myfind to {match case:false, match whole word:false, match wildcards:true}
set findResult to execute find myfind find text "\\[*\\]" replace with myfind replace replace all with highlight
#close active document saving yes
end tell
I have tested the above script and it do find the word I wanted it to find (if replace with "", all text in a square bracket will be deleted, that's the way i tested it)
But the need is to find the text in square bracket, and HIGHLIGHT them for further edits. I've read the dictionary but struggling to understand how it could be achieved.
Also like to know how to return the find items, instead of boolean? the current result returns true or false indicating if there is any finding, but if it can point out which exactly find, maybe can try highlight it seperately?
Many thanks in advance!