Results 1 to 3 of 3
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I have been hunting around for a solution for what seems to be a sensible question- How can I start an Access 2007 application with the Ribbon minimized? I don't want to hide the ribbon, or replace it with a custom ribbon. I found lots of others asking the same question, but no satisfactory answers...until just now. Found this and it seems to work.

    By itself SendKeys "^{F1}" toggles the state of the Ribbon. By testing its height, you can minimize it if it is not already minimised.

    Code:
       
       If Application.CommandBars.Item("Ribbon").Height > 100 Then
    	SendKeys "^{F1}"
       End If
    Regards
    John



  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I just tested this code in Access 2003, and (as expected) it throws as error, as Access 2003 (and older versions) does not know about the Ribbon.

    So the code needs an Error Handler that handles error number 5.

    PS The reason for Minimising the Ribbon is that I design things for a screen resolution of 1024 x 768. Unless the ribbon is minimised, things don't fit on the screen.
    Regards
    John



  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could also check the Access version:

    Code:
    If Val(Application.Version) >= 12 Then
      If Application.CommandBars.Item("Ribbon").Height > 100 Then
    	SendKeys "^{F1}"
      End If
    End If
    The If statements must be nested, you can't combine them into one.

Posting Permissions

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