Good news, I've got it working how I had imiagined however I am only able to highlight/copy text from a word document or a body of an email. I am unable to complete the search using text from an email heading (outlook) or text from the internet. I am truly puzzled!
The script fails on line 8, xl.ActiveSheet.Range("A1").PasteSpecial(-4163)
Coding is as follows:
Code: Select all
$F1::
Send, {LCtrl Down}c{LCtrl Up}
var0 := clipboard
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open("AHKform5.xlsx"), xl.Visible:=False
xl.ActiveSheet.Range("A1").PasteSpecial(-4163)
Xl.ActiveSheet.Range("A2").Copy
Var1 := clipboard
Xl.ActiveSheet.Range("A3").Copy
Var2 := clipboard
Xl.ActiveSheet.Range("A4").Copy
Var3 := clipboard
Xl.ActiveSheet.Range("A5").Copy
Var4 := clipboard
ToolTip,
(Join LTrim
Account Number: %var0%`n
Account Name: %var1%Risk Rating: %var2%Business Type: %var3%Revenue: %var4%
)
settimer, cleartt, -5000
Return
cleartt:
tooltip
Return
Furthermore...
xl.ActiveSheet.Range("A1").PasteSpecial(-4163)
If I change the above line to:
xl.ActiveSheet.Range("A1").PasteSpecial()
I am able to copy from the internet and email headings but now the script does not work for word documents and text on the body of an email!