【问题标题】:how to use textbox value to search folder for pdf file and open pdf file如何使用文本框值在文件夹中搜索 pdf 文件并打开 pdf 文件
【发布时间】:2019-12-21 12:03:45
【问题描述】:

我想使用 textbox1 值在文件夹中搜索 pdf 文件并打开 pdf 文件。

    iso = Me.TempCombo.Value
    If Me.TempCombo.Value = "" Then
        Exit Sub
    End If
finalrow = Sheets("Hyperlink").Range("A6000").End(xlUp).Row

For i = 2 To finalrow
    If Sheets("Hyperlink").Cells(i, 1) = iso Then
        Me.TextBox26 = Cells(i, 1).Value & Worksheets("Hyperlink").Cells(i, 1).Value


        End If

    Next i

ActiveWorkbook.FollowHyperlink Address:="\\OPDD-2UA8302DBK\Users\rossa1\Desktop\Portal to Andrew Side\TORQUE MAPS\" ' & Me.TextBox26.Value"

End Sub

【问题讨论】:

  • textbox26 中的值来自工作表“超链接”上的超链接单元格,当我单击单元格时,它会在 adobe 中打开超链接。我喜欢 textbox26 值做同样的事情。这可能吗?

标签: excel vba pdf userform openpdf


【解决方案1】:

您可以使用以下方法打开 pdf 文件:

Sub test()
    Filename = TextBox1.Text
    ActiveWorkbook.FollowHyperlink Filename
End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-26
    • 2011-07-29
    • 2018-12-17
    • 1970-01-01
    • 2021-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多