[AHK]在Excel中用热键创建超链接

来源:互联网 发布:华南理工大学网络 编辑:程序博客网 时间:2024/05/20 07:37

Hyperlink in Excel 2010 using COM?

https://autohotkey.com/board/topic/72914-hyperlink-in-excel-2010-using-com/


F1::; example 1:设置Excel的热链接oExcel := ComObjActive("Excel.Application")filePath:="X:\ahk\excel\Picture.png"oExcel.ActiveSheet.Hyperlinks.Add(oExcel.ActiveCell,filePath,"","Click here to see Picture","Picture")returnF2::; example 2: http://www.autohotkey.com/forumoExcel := ComObjActive("Excel.Application")oExcel.ActiveSheet.Hyperlinks.Add(oExcel.ActiveCell, "http://www.autohotkey.com/forum","","Click here to visit Autohotkey forum","Autohotkey forum")returnF3:: html=http://www.autohotkey.com/forumtext=Click here to visitHyper1 = =hyperlink("%html%","%text%")xl :=   ComObjActive("Excel.Application")xl.ActiveCell.Formula :=   Hyper1returnF4:: html:="X:\ahk\excel\Picture.png"text=Click here to visitHyper1 = =hyperlink("%html%","%text%")xl :=   ComObjActive("Excel.Application")xl.ActiveCell.Formula :=   Hyper1return


0 0