+ Reply to Thread
Results 1 to 13 of 13

display pdf in userform as a small picture in image box

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    display pdf in userform as a small picture in image box

    hi
    I am trying to show a pdf file in a userform set in an image box,at the minute I use hyperlink from commandbutton4 which looks at textbox15 entry, this all works well ,whatever I double click on in listview box then cmd4(print) that image appears,i thought I could do similar and use hyperlink with imagebox ,but can not get syntax right,never done imagebox before,my idea is whatever one I pick a little picture would appear automatically and if right one click print,have read plenty about loading pictures from worksheet and from a directory,problem with that is my pics are in different directories ie 100unit=100dir,200unit=200dir and so on,has anyone got any ideas please,think some sort of hyperlink seems the right way but im only guessing
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 07-28-2013 at 01:40 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    I don't think you can display PDFs in an image control, because they aren't images.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    thanks for that, I think, sort of spoilt my train of thinking there,my hyperlink does full screen but how to condense to fit,could I use textbox or another userform
    cheers colin

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    You could try a WebBrowser control.

  5. #5
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    ok ill have a look round at what that is
    cheers colin

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    It's just the wee globe that should be on the Toolbox.

    You can load a PDF to it like this.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    have put browser on toolbox and adjusted code to my directory,but can not get it to do anything,will not even error for wrong path
    cheers colin

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    How/when are you trying to load the PDF in the web browser?

    Can you post the code you used?

  9. #9
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    I put it in listveiw control and works ,but only brings the first pdf up on each of the plans you click on
    cheers colin
    Attached Files Attached Files

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    You only have this line for the web browser.
    Please Login or Register  to view this content.
    That's only ever going to load one pdf, '50tpipecst.pdf'.

    Do want to load one of the PDFs listed in column O when a user selects from the listbox?

  11. #11
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    yes column o is the one that loads when selected
    cheers colin

  12. #12
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    747

    Re: display pdf in userform as a small picture in image box

    hi norie
    still having problems with this ,have decided to use .jpeg for image control and put hypelink in cell "o" ,this works well as pic comes on instantly, you click item in listview
    only prob is getting it to appear in image box as opposed to just appearing on screen,will use another hyperlink to print pdf from commandbutton as before,any idea how
    can get .jpeg to fit and appear in box please, or anyone else have any suggestions
    cheers colin
    Attached Files Attached Files

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: display pdf in userform as a small picture in image box

    Colin

    If you want to load a picture in an image control use LoadPicture.

    By the way, you never really explained the problem with the Webbrowser and pdfs.

    If you wanted to load the relevant pdf you would take the address and filename from column O.
    Last edited by Norie; 07-28-2013 at 06:22 AM.

+ 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. Replies: 1
    Last Post: 02-15-2015, 08:45 PM
  2. How to access bitmap picture stored as property of image control on userform
    By Spere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2013, 05:41 PM
  3. how to display an image in userform
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 06:53 AM
  4. How to display an image picture in a thread.
    By MarvinP in forum Excel Tips
    Replies: 7
    Last Post: 07-16-2012, 01:17 PM
  5. [SOLVED] Screen flicker when changing Image.Picture source on UserForm
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2005, 10:06 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