Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Getting an Image into an OLE Field (XP)

    I have an application that uses just two images and the client wants to store them in OLE fields. I Have a field for the path to the Image as well.
    I allow the user to get the path to the image using a file dialog.

    How do I get that image into the OLE field using VBA code. Say in the after update event of the path field.

    It is just a bit cumbersome to have the user use the insert from the menu.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Getting an Image into an OLE Field (XP)

    You can use code like this, assuming that a picture has already been loaded at least once before:

    With Me.oleCtl
    .SourceDoc = Me.txtPath
    .Action = acOLECreateEmbed
    End With

    where oleCtl is the name of the OLE control and txtPath is the name of the text box containing the path and filename.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Getting an Image into an OLE Field (XP)

    Thanks Hans, I'll give that a go.

Posting Permissions

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