Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 如何在internet explorer中打开pdf超链接并转到Excel vba中的特定页面?_Internet Explorer_Vba_Pdf - Fatal编程技术网

Internet explorer 如何在internet explorer中打开pdf超链接并转到Excel vba中的特定页面?

Internet explorer 如何在internet explorer中打开pdf超链接并转到Excel vba中的特定页面?,internet-explorer,vba,pdf,Internet Explorer,Vba,Pdf,我想在internet explorer中打开pdf超链接,然后使用excel VBA转到特定页面 有人知道怎么做吗?感谢您的帮助。上面的第一条评论对于链接到特定页面非常有用。下面是使用VBA打开这些链接的两种方法 可以使用FollowHyperlink方法模拟单击链接。链接将在默认浏览器中打开,用户将得到安全提示 Sub OpenPDF_to_page_2_Method_1() Const PDF_PATH = "http://www.adobe.com/support/products/

我想在internet explorer中打开pdf超链接,然后使用excel VBA转到特定页面


有人知道怎么做吗?感谢您的帮助。

上面的第一条评论对于链接到特定页面非常有用。下面是使用VBA打开这些链接的两种方法

可以使用FollowHyperlink方法模拟单击链接。链接将在默认浏览器中打开,用户将得到安全提示

Sub OpenPDF_to_page_2_Method_1()
  Const PDF_PATH = "http://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"
  ThisWorkbook.FollowHyperlink PDF_PATH & "#page=2"
End Sub
或者,您可以创建新的Internet Explorer对象并导航到PDF。这将使用Internet Explorer,而不考虑默认浏览器,并且在打开链接之前不会向用户提供安全提示

Sub OpenPDF_to_page_2_Method_2()
  Const PDF_PATH = "http://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"

  Dim IE As Object 
  Set IE = CreateObject("InternetExplorer.Application")
  IE.Visible = True
  IE.Navigate (PDF_PATH & "#page=2")
  Set IE = Nothing
End Sub

http://www.example.com/myfile.pdf#page=4