跟着楼上混!帮忙加了一点料![em04] 考虑了文件有多个的情况! Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim TR TR = Target.Row If Cells(TR, 1) <> "" And Cells(TR, 2) <> "" And Cells(TR, 2) <> "" Then If Target.Count = 1 Then If TR > 2 And Target.Column = 3 Then Dim wdApp, MyFound As Boolean With Application.FileSearch .FileType = msoFileTypeWordDocuments .LookIn = ThisWorkbook.Path .Filename = "*" & Target & "*" If .Execute > 0 Then Dim fcount Set wdApp = CreateObject("word.application") wdApp.Visible = True For fcount = 1 To .Execute wdApp.Documents.Open .FoundFiles(fcount) Next Else MsgBox "文件未找到" End If End With End If End If End If End Sub
PS:楼主可别用2007玩这个哦,不兼容地![em01] |