Rocky Smolin
rockysmolin at bchacc.com
Sat Mar 1 09:10:39 CST 2014
I'll give that a shot. If I change cstrRibbonName to "Print Preview" will that show the print preview ribbon then on opening the report in Preview? Thanks R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, March 01, 2014 12:11 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Show the print preview ribbon Hi Rocky As I understand it, you cannot rely on SendKeys (don't know why). So I posted this a year ago which has worked fine for me: <code> Public Function EnableRibbon(Optional ByVal varEnable As Variant) As Boolean ' Set or toggle if the Ribbon should be collapsed or enabled. ' ' 2013-02-08. Cactus Data ApS, CPH. ' ' Can be used with AutoExec macro to minimize the Ribbon at launch: ' EnableRibbon(False) ' Height of Ribbon when enabled: 141 ' Height of Ribbon when collapsed: 53 Const clngRibbonHeight As Long = 97 Const cstrRibbonName As String = "Ribbon" Dim booEnabled As Boolean ' Continue on error and toggle the collapsing of the Ribbon. On Error Resume Next ' Make the Ribbon visible as a hidden ribbon cannot be controlled. DoCmd.ShowToolbar cstrRibbonName, acToolbarYes ' Measure if the Ribbon is collapsed or enabled. booEnabled = (Application.CommandBars(cstrRibbonName).Height > clngRibbonHeight) If IsMissing(varEnable) Or (booEnabled Xor CBool(varEnable)) Then ' Toggle the collapsing of the Ribbon. CommandBars.ExecuteMso "MinimizeRibbon" booEnabled = Not booEnabled End If ' Return the current state of the Ribbon. EnableRibbon = booEnabled End Function </code> /gustav ________________________________________ Fra: accessd-bounces at databaseadvisors.com <accessd-bounces at databaseadvisors.com> på vegne af Rocky Smolin <rockysmolin at bchacc.com> Sendt: 1. marts 2014 07:12 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] Show the print preview ribbon Any way to maximize the ribbon? I'd like to maximize the Print Preview ribbon in the open even of a report. Tia r -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com