国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

從Excel 單元格定位到Word 文檔中指定的位置帶來的思考

2024-07-21 02:25:02
字體:
來源:轉載
供稿:網友


'以下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~~

const tc3 = "tc03_軟體版權管理/tc03_software license management"
const tc4 = "tc04_配備資源管理/tc04_periphery resource"
const tc10 = "tc10_資料安全管理/tc10_data security management"

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
   
    'a.documents.open "h:/0408/pcmain5.5.0 _other.doc"
    'msgbox a.path
    'msgbox application.path
    'msgbox curdir
    'msgbox a.documents.item(0).fullname
   
    a.documents.open path & "/" & filename & ".doc", readonly:=true
    a.selection.goto what:=wdgotobookmark, name:=bookmark
    a.visible = true
    a.activate '前臺顯示word窗體
end sub

private sub label1_click()
    gotoword tc3, "tc3_1"
end sub

private sub label10_click()
    gotoword tc4, "tc4_4"
end sub

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桐柏县| 博白县| 苏尼特右旗| 大荔县| 宜君县| 惠水县| 永福县| 漠河县| 上栗县| 合江县| 故城县| 兴安县| 宽城| 枣强县| 离岛区| 宜兰县| 鄯善县| 闸北区| 河北区| 茶陵县| 滦南县| 巴中市| 新巴尔虎右旗| 南京市| 济源市| 西充县| 麻栗坡县| 宿州市| 香港 | 文安县| 犍为县| 军事| 大安市| 阳新县| 靖西县| 徐汇区| 科技| 淄博市| 区。| 吴旗县| 尚义县|