'以下vba脚本实现标题阐述功能,考虑以下问题: 如何捕获一个cell单元格的单击事件?excel 中能否添加处理其他的windows 消息? 'unit : mcc 'fun : goto exactly position in word from excel impls by vba. 'args : bookmark string(predefined in word handed yourself or using tools) 'ref : ms word/excel object lib. 'modify : 1.open word archives in readonly way 2.get abs path using for anchor 'future : 1.search by string exactly 'author : qjwxsd 'dt : 2005-04-18~~
public sub gotoword(filename, bookmark as string) on error resume next dim a as word.application dim b as word.document
dim c as excel.application dim d as excel.workbook dim e as excel.worksheet
dim path as string
set c = getobject(, "excel.application") set d = c.activeworkbook set e = d.activesheet 'path = c.path path = d.path '取得当前功能清单的路径,传到word中。否则word无法取得路径, '打开相应的tc。 set a = getobject(, "word.application") if a = null then set a = createobject("word.application") end if