Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Picture Library in Userform (any)

    I have a library of bitmaps on a userform. How can I insert them into a document?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Star Lounger
    Join Date
    Jun 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    Funnily enough Kev my boss just asked me to do the same thing.
    I need to allow our sponsors to insert a selected inline graphic (warnings, etc) into a document.

    My basic soln is to use Selection.InlineShapes.AddPicture ... as the double-click event behind each picture.
    the graphic is then placed at the insertion point much like the smilies in this lounge.

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    Frank,

    That's pretty clever. But, I think my situation is a bit different. My userform is hidden - the user never sees it.
    I want to use it store the images so I don't have to go to disk to get them. I can't find a method that selects
    an image in a hidden userform so it can be assigned as the range of an autotext entry.

    I know. I'm weird.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Star Lounger
    Join Date
    Jun 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    I'm having a slow day I'm afraid, but how does your user select from a collection that sheim ( thats a 'she' or 'him') can't see

    farnk <img src=/S/aussie.gif border=0 alt=aussie width=21 height=22>

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    The user is only indicating what type of envelope they want to print -- they pick from a list of return addresses in a dropdown which then populates a text box.. My code then determines which logo to grab. They don't see the image until they retrieve their envelope from the printer!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Star Lounger
    Join Date
    Jun 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    You're well beyond me. Sounds like a useful technique, if only I was intelligent enough to spell my name correctly
    I might even understand how to assign a picture image as a AutoText

    Frank <img src=/S/toilet.gif border=0 alt=toilet width=24 height=26>

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    Here's how:

    1) Select the picture:

    thisdocument.shapes("ThatNamedShape").select


    2) Assign selected range to Autotext range:

    normaltemplate.AutoTextEntries.Add(Name:="Blabla", Selection.Range)

    I had to abandon this approach because "thisdocument" must be open (I assume visible too); in my case it's a global template
    installed for each user, but not visible. Therefore, "thisdocument.shapes("ThatNamedShape").select" produced an error.
    "
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    Star Lounger
    Join Date
    Jun 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    Unfortunately Kev my brain still hurts!!!

    Using the brute force and no trippy programming method. I just toggle the AttachedTemplate between the global containing the AutoText
    - at which point the AutoText will work, and the 'parent' template - where you now have you piccie and everything else will now work.

    I don't know enough about how to program in VBA to figure out a solution just a roundabout way to sorta get
    whats required. eer maybe
    Frank <img src=/S/headthrob.gif border=0 alt=headthrob width=15 height=15>

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Picture Library in Userform (any)

    It's a bit easier than that: You can insert AutoText from any open template by referencing it through the Templates collection. See <!post=Post #125909,125909>Post #125909<!/post>.

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Picture Library in Userform (any)

    What do you make of this from the online help?
    <hr><big>Things you can do with a picture on an Image control</big>

    An Image control is not a picture itself; rather, it contains a picture that is stored in a separate file. You cannot edit the picture with the properties of the Image, but you can use them to specify the way the picture appears on the Image.<hr>
    How are you "storing" the images on a UserForm?

  11. #11
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Picture Library in Userform (any)

    It means that no matter how hard you try (resize, crop, slice, or dice), the image is going to make your file huge, so that you'll have to buy a new hard drive to have enough space, then a new BIOS to support it, and finally a new OS to keep Bill happy. --Sam <img src=/S/notmyfault.gif border=0 alt=notmyfault width=15 height=15>
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    >>What do you make of this from the online help?

    It just means you can only tweak the appearance of images on userforms.

    I was hoping there would be a .copy method on the image control that allowed the image to go to the clipboard without having to show the userform and select the picture.

    >>How are you "storing" the images on a UserForm?

    The images are simply sitting in image controls on the userform.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. #13
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Picture Library in Userform (any)

    Ah, I think that I understand now. <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15> If we just had a clipboard object, we would be done. You should be able to use clipboard API calls to copy the object returned by the Picture property of the Image control to the clipboard. Maybe the API examples at vbaccelerator will help. Also look at VBdimond. I'd like to see the code if you figure it out. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  14. #14
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Picture Library in Userform (any)

    My workaround will have to do for now. I've put the images in the global add-in document space (Insert>Picture),
    and created autotext entries for them. When I want one inserted into the activedocument, I insert the autotext.

    The purpose of all this? I don't have to deliver image files with the app. They're all IN the app.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  15. #15
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Picture Library in Userform (any)

    Another solution is to create an ActiveX control in VB that contains the VB clipboard object, then insert this control on your userform. That's the easiest solution, if you have VB, but then you would have to distribute that control with your app. Bet there's just one API call to copy a picture to the clipboard, but I haven't the time to find it. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Page 1 of 2 12 LastLast

Posting Permissions

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