Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    Is it possible to use a command button on my Excel 2007 UserForm that will open an existing PDF File

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Yes, using the FollowHyperlink method of the Workbook object:

    Code:
    Private Sub cmdOpenPDF_Click()
      Dim strFile As String
      ' Path and filename of PDF file
      strFile = "C:\Test\Manual.pdf"
      ActiveWorkbook.FollowHyperlink strFile
    End Sub
    The PDF file will be opened in the application associated with the PDF extension on the user's computer.

  3. #3
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    [quote name='HansV' post='786990' date='31-Jul-2009 07:36']Yes, using the FollowHyperlink method of the Workbook object:

    Code:
    Private Sub cmdOpenPDF_Click()
      Dim strFile As String
      ' Path and filename of PDF file
      strFile = "C:\Test\Manual.pdf"
      ActiveWorkbook.FollowHyperlink strFile
    End Sub
    The PDF file will be opened in the application associated with the PDF extension on the user's computer.[/quote]
    Hi HansV
    Thank you, I shall give her a try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •