Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Petr Danes is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    18
    No, I guess I didn't explain it properly. That's what I thought was going on, when I tested it at the customer's site, and when I started the thread.

    What's actually happening is I'm loading the image from an OLE object field into a Ribbon Command Button. The button initialization callback routine getImage retrieves the image from a table, and returns it to the getImage routine, using this code:

    Public Function getIconFromTable(strFilename As String) As Picture
    Dim LSize&, arrBin() As Byte, rst As DAO.Recordset
    Set rst = DBEngine(0)(0).OpenRecordset("tblBinary", dbOpenSnapshot)
    With rst
    .FindFirst "[FileName]='" & strFilename & "'"
    If .NoMatch Then Stop ' Programátorská chyba, nemělo by se stát.
    LSize = .Fields("binary").FieldSize - 1
    ReDim arrBin(LSize)
    arrBin = .Fields("binary")
    Set getIconFromTable = ArrayToPicture(arrBin)
    .Close
    End With
    Set rst = Nothing
    End Function

    The function ArrayToPicture is what I'm using to convert the OLE object to its usable form for a button icon.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    The example db's were built as mdb files. mdb structure is very different from accdb. It's nice they still run in Access 2007 and 2010. I do not have 2013 and probably never will.

    The fact no one else has jumped in by now is an indicator that finding answer through forum is unlikely. I certainly have nothing else to offer except Good Luck.
    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. #18
    Petr Danes is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    18
    Okay, thanks for trying. Here's the site that set me onto this in the first place:

    http://www.accessribbon.de/en/?Acces...ontrols#basGDI

    You'll notice that it is meant for .accdb, not .mdb, since that format came with 2007 - ribbon controls didn't exist prior to that. But apparently something else has changed between in 2013. It still works okay in 2010, and runs on both 32- and 64-bit machines.

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I am familiar with Avenius site. It helped me build custom ribbon. I didn't need any custom icons.
    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.

  5. #20
    Petr Danes is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    18
    Unfortunately, I did need them. I looked all through the built-in ones I could find - it would have made this a lot easier, but what I needed just wasn't there.

    But I'm confused - since you're familiar with this site, why did you mention .mdb files? I'm doing ribbon icons, and even Lebans' last activities on his site postdates the arrival of 2007 and the .accdb format by several years.

    This all has to do with moving images, not Access' internal file format.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    The downloads I found from Lebans site were mdb files. They didn't deal with customizing menu or ribbon.
    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.

  7. #22
    Petr Danes is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    18
    Yeah, Lebans did most of his development back in the .mdb days. Pity he dropped out of the game - he wrote some insanely useful stuff. Would have been nice if Microsoft had incorporated it into their newer releases, especially after he quit. But everything of his that I've used so far, including this, has worked fine in the new format, which is a remarkable feat in itself, and a testament to the quality of his code.

    Something else is wrong here - not Lebans' code - that was a mistake on my part, thinking that was where the problem was. The problem is loading the ribbon icon images, which has nothing to do with Lebans' code, except that those buttons then call some of his routines when the user presses them. And it's a problem in 2013, not 2007 or 2010, so the .accdb format has nothing to do with it. It's a problem locating and using that pesky graphics .dll, whatever it has become in the 2013 release.

    But again, thanks for trying - I'll post back in this thread if I ever get it figured out.

  8. #23
    Petr Danes is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    18
    Well, I got it. Wrote the guys at Avenius directly. Unbelievable response - I wrote them Friday evening, actually after midnight Friday night. When I woke up Saturday morning, a working solution from them was waiting in my Inbox.

    They call GDIPlus.dll, instead of OGL.dll. I thought that was one of the variations I tried when working on this problem myself, but apparently I either did it wrong, or there is something else in the code that I'm missing. I will have to put the routines up side by side and see what they did.

    In any case, I can't praise these these guys enough. Here is one of their sites, for anyone else reading this: http://www.ribboncreator2013.de/en/ Crammed full of useful information and great software. If you have ribbon problems or questions, try them first.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Working with Graphics
    By WiReLaD in forum Database Design
    Replies: 12
    Last Post: 04-19-2013, 07:01 AM
  2. Lebans Continuous Forms Control Tip - In Subform
    By Whizbang in forum Programming
    Replies: 4
    Last Post: 01-16-2013, 08:17 AM
  3. Auto-size Text in Report or Form - Possibly Lebans
    By shane201980 in forum Programming
    Replies: 5
    Last Post: 10-29-2012, 12:24 PM
  4. Replies: 10
    Last Post: 01-04-2012, 01:43 PM
  5. Message Graphics
    By pkstormy in forum Access
    Replies: 0
    Last Post: 01-01-2011, 10:48 PM

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