Results 1 to 3 of 3
  1. #1
    MMMSOARES_2011 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    6

    How to Create a Button that Opens a PDF file in a specific Page

    Hello

    IŽd like to create a button (in a form) that will open a pdf file in a specific page. I found this code bellow in another forum and it worked fine, but the problem is that, in my case, both the path of the file and the specific page in wich i want it to open at are fields of a table. So please iŽd like to adapt this code to make it work for me or iŽd like to get another code that would also work. Please give me the full syntax. Thank you very much in advance!

    Shell Chr$(34) & "C:\PathToAcrobat\Acrobat.exe" & Chr$(34) & _


    " /A " & Chr$(34) & "page=2=OpenActions" & Chr$(34) & _
    Chr$(34) & "C:\PathToFile\MyFile.pdf" & Chr$(34)

    In my case:

    The number of the page is stored in the field called Section_Begin_Page of a table called 5_Section

    The path of the pdf file to open is stored in the field Volume_link of a table called 3_Volume

    Thank you very much in advance!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Concatenating a variable into the Shell statement is easy. The trick is figuring out how to retrieve the values from tables. Do you have that part resolved?

    Shell Chr$(34) & "C:\PathToAcrobat\Acrobat.exe" & Chr$(34) & _
    " /A " & Chr$(34) & "page=" & pagevariable & "=OpenActions" & Chr$(34) & _
    Chr$(34) & filepathvariable & Chr$(34)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MMMSOARES_2011 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    6
    Hello, June7

    Sorry for my late reply. In the first 2 days i had no replies so i focused in other problems and stopped watching this forum. That was exactly when you came with your message. Thank you very much for the attention!

    I solved this problem with the help of people from another forum. No code would work. And i found 3 different ways of doing it, 3 right codes that wouldnŽt work here. In the end i discovered that it was all caused by the fact that the field with the "path to file" was defined as LINK, not as TEXT. So now itŽs solved.

    Thank you very much anyway!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-28-2011, 09:54 PM
  2. create On Click to go to specific server folder
    By airhud86 in forum Programming
    Replies: 1
    Last Post: 01-05-2010, 12:45 PM
  3. Form opens differently from control button
    By bdaniel in forum Programming
    Replies: 5
    Last Post: 12-29-2009, 12:38 PM
  4. Replies: 0
    Last Post: 12-16-2009, 09:28 AM
  5. Create a command button to Browes for file
    By sawill in forum Programming
    Replies: 3
    Last Post: 03-15-2009, 05:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums