有没有办法用绕过执行文件路径的VB函数打开pdf(Acrobat.exe)
Is there a way to a open a pdf with a VB function that bypass the path of the executing file (Acrobat.exe)
我有一个 MS-Access 数据库,多个用户使用不同的计算机设置(有些人使用 Windows XP,其他人使用 Windows 7 和 Adobe Reader 版本 11.0 或12.0 等)。有没有办法打开(从表单中的命令按钮)pdf 文件(使用 Adobe Reader)和 VB 函数绕过执行文件路径的一部分(Acrobat.exe)?
目前,我有这个 VB 功能。
Call Shell("""C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
我想要这样的东西:
Call Shell("""C:\GoAndGetTheAcrobat.exeFile"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
提前致谢
是的,您可以使用 Shell object to run the file。
' Use Windows shell to run file.
Sub WinRun()
Dim shell As Object
Set shell = CreateObject("WScript.Shell")
shell.Run "Your-Drive:\Your-Path\Your-File.pdf"
End Sub
您可以使用命令 start.exe 而不是使用应用程序路径,它会为您的文件启动默认应用程序:
start.exe [path_to_your_pdf_file]
所以你可以试试:
Call Shell("""start.exe"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
您可以像双击一样启动任何 windows 文件:
application.FollowHyperlink "full path name to any windows file"
致电 Shell("""C:\GoAndGetTheAcrobat.exeFile"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & 我![Element_id] & ".pdf", 1)
我有一个 MS-Access 数据库,多个用户使用不同的计算机设置(有些人使用 Windows XP,其他人使用 Windows 7 和 Adobe Reader 版本 11.0 或12.0 等)。有没有办法打开(从表单中的命令按钮)pdf 文件(使用 Adobe Reader)和 VB 函数绕过执行文件路径的一部分(Acrobat.exe)?
目前,我有这个 VB 功能。
Call Shell("""C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
我想要这样的东西:
Call Shell("""C:\GoAndGetTheAcrobat.exeFile"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
提前致谢
是的,您可以使用 Shell object to run the file。
' Use Windows shell to run file.
Sub WinRun()
Dim shell As Object
Set shell = CreateObject("WScript.Shell")
shell.Run "Your-Drive:\Your-Path\Your-File.pdf"
End Sub
您可以使用命令 start.exe 而不是使用应用程序路径,它会为您的文件启动默认应用程序:
start.exe [path_to_your_pdf_file]
所以你可以试试:
Call Shell("""start.exe"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & Me![Element_id] & ".pdf", 1)
您可以像双击一样启动任何 windows 文件:
application.FollowHyperlink "full path name to any windows file"
致电 Shell("""C:\GoAndGetTheAcrobat.exeFile"" ""C:\DOCUMENTS\DOCUM\SPECS\Faune_DEV\SP" & 我![Element_id] & ".pdf", 1)