+ Reply to Thread
Results 1 to 13 of 13

Cannot view, page & zoom PDF on User Form

  1. #1
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Cannot view, page & zoom PDF on User Form

    Hi There

    I have a problem with opening a specific PDF on a User Form. The PDF name/number must be selected in a textbox on the user form. The PDF must then display on the actual user form.

    The problems I have to overcome is:
    1. Cannot get the specific PDF (chosen in the text box on user form) to show.
    2. Do not know how to set the command buttons “Previous Page” & “Next Page” to enable me to page through a multipage PDF.
    3. Do not know how to set command for “Zoom In” & Zoom Out” to enable me to look closer on specific detail on a PDF.

    I am not even sure if the Paging or Zooming is possible?
    1. Does anyone know what am I doing wrong in my code as to why the PDF won’t open on the User Form?
    2. Does anyone know how to set the command buttons “Previous Page” & “Next Page”?
    3. Does anyone know how to set the command buttons “Zoom In” & Zoom Out”?

    Any help will be greatly appreciated. See attached file.
    Attached Files Attached Files

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Cannot view, page & zoom PDF on User Form

    Use a webbrowser control, not the acrobat control. This will then init the default plugin for IE so will show all the normal controls without you having to add them manually

  3. #3
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Quote Originally Posted by Kyle123 View Post
    Use a webbrowser control, not the acrobat control. This will then init the default plugin for IE so will show all the normal controls without you having to add them manually
    I have no idea how the code for the web browser control should look like as I have also never tried it. The unit on which the spreadsheet will be used will have a lock down with no internet access. Will above not be affected by this? If not can you place a sample code of how it should look? Tks

    I have managed to get the PDF TO open on the User Form with the code below.
    Please Login or Register  to view this content.
    However how can I get the code above to look at a specific entry as the above number "50081" will change with every new entry. I have tried to change it to look at a specific text box entry but could not get it to work. Any idea?
    Last edited by Colin Smit; 10-07-2014 at 08:40 AM.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Cannot view, page & zoom PDF on User Form

    No, it doesn't need internet access. It would look like this:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Quote Originally Posted by Kyle123 View Post
    No, it doesn't need internet access. It would look like this:
    Please Login or Register  to view this content.
    How do I have the part of the code referring to the PDF number (In above sample it is 50081) refer to a textbox value that was input in a User Form? In other words if I type in a different item number I will get the specific PDF related to that item.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Cannot view, page & zoom PDF on User Form

    THe same way I showed you in your other thread

  7. #7
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Will look at it. Tks

  8. #8
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Quote Originally Posted by Kyle123 View Post
    THe same way I showed you in your other thread
    I have tried below with no success.
    Please Login or Register  to view this content.
    I also tried below code with no success.
    Please Login or Register  to view this content.
    Not sure how to correct it as I am not that knowledgeable in VBA and still learning my way around it.
    Last edited by Colin Smit; 10-07-2014 at 09:45 AM.

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Cannot view, page & zoom PDF on User Form

    Neither of those are the code I gave you in the other thread. Read it carefully

  10. #10
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Are you referring to below code?
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Thank you for the help. I managed to get the PDF selected and opened. See code below.
    What must I add in below code to show error if the item number selected has no PDF present? Currently if I select a number for which I know a PDF does not exist, then it throws me back to the VBA Code. With a unit set up on lock-down I want to try and prevent this. Rather the User Form show a N/A in the PDF Block if possible?

    Please Login or Register  to view this content.
    Another reason why I decided to use the PDF plug-in is because the unit will be on lock-down software with only a Numb-Keypad connected to the unit. (No Mouse or Keyboard will be connected) With the Tab Button on the Numb-Keypad it is easy to move from one button to another button on the User Form hence the reason for wanting to use the "Previous Page", "Next Page", "Zoom In" & "Zoom Out" buttons on the User Form. Do you know how to set the command for these buttons?

    With your previous mentioning of using the Web Browser Control...Will these functions also be available in such a manner?
    Last edited by Colin Smit; 10-07-2014 at 02:50 PM.

  12. #12
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Cannot view, page & zoom PDF on User Form

    Why not try it and find out? I suspect the experience will vary depending on the pdf reader installed.

    You can use the dir function to check whether a file exists

  13. #13
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    Re: Cannot view, page & zoom PDF on User Form

    Quote Originally Posted by Kyle123 View Post
    Why not try it and find out? I suspect the experience will vary depending on the pdf reader installed.

    You can use the dir function to check whether a file exists
    Your suspicion is correct! I have tested it yesterday on a sample machine and found out that the PDF reader installed had to be updated. Although it is not a big issue as we have a very good network infrastructure through which these type of problems can easily be corrected remotely, your idea on using a Web Browser might be the better option. I will experiment with the Web Browser later today and give feedback.

    Thank you for your advice and feedback thus far.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. View Word Document on User Form?
    By nevi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2012, 02:53 PM
  2. View 1st Record through User Form Automatically
    By Shazz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-03-2012, 11:17 AM
  3. Code to view Hyperlinks through User form
    By Shazz in forum Excel General
    Replies: 0
    Last Post: 02-01-2012, 10:16 AM
  4. How to add zoom option on a picture displayed on User form
    By fakm79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2011, 06:36 AM
  5. User Form to select Custom View
    By sburgess in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2009, 11:51 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1