Results 1 to 10 of 25

Thread: Ribbon Calendar DatePicker Word 2007-2010

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    Junior Member
    Join Date
    Aug 2013
    Posts
    9
    Rep Power
    0
    Hi,

    The end of last week I was looking for a drop-down ribbon calendar and cam across this post. It inspired me to come up with my own solution as I wanted to have a couple of drop-down calendars, that could be used for something like, Start Date and End Date in conjunction with a "Run Report" button.

    I ended up creating the following as an initial test:

    cal1.JPG

    cal2.JPG

    The sample has two calendars in but, it could easily be 1, 3, 4, 5, etc....

    The xml for a single calendar is as follows:

    PHP Code:
    <box id="box_cal1" boxStyle="horizontal">
        <
    labelControl id="lblCalName_cal1" 
                    
    getLabel="getCalendarLabel" 
                    
    getVisible="getCalendarLabelVisibility"
                    
    tag="rxgal_cal1"/>
        <
    buttonGroup id="butGrp_cal1">
            <
    button id="butPrevYear_cal1" 
                    
    imageMso="OutlinePromoteToHeading" 
                    
    onAction="rxbut_PrevYear"  
                    
    tag="rxgal_cal1"
                    
    screentip="Previous Year"/>
            <
    button id="butPrevMonth_cal1" 
                    
    imageMso="OutlinePromote" 
                    
    onAction="rxbut_PrevMonth" 
                    
    tag="rxgal_cal1"
                    
    screentip="Previous Month"/>
            <
    gallery id="rxgal_cal1" 
                    
    getLabel="rxgal_getLabel" 
                    
    columns="7"
                    
    rows="7"
                    
    getItemCount="rxgal_getItemCount"
                    
    getItemLabel="rxgal_getItemLabel"
                    
    onAction="rxgal_Click"
                    
    showItemLabel="true"
                    
    tag="rxgal_cal1"
                    
    getScreentip="rxgal_getScreentip"
                    
    getSupertip="rxgal_getSupertip">
                <
    button id="butYesterday_cal1" 
                        
    imageMso="ProposeNewTime" 
                        
    label="Yesterday" 
                        
    onAction="rxbut_Yesterday"   
                        
    tag="rxgal_cal1"/>
                <
    button id="butToday_cal1" 
                        
    imageMso="AccessListEvents" 
                        
    label="Today" 
                        
    onAction="rxbut_Today"    
                        
    tag="rxgal_cal1"/>
                <
    button id="butTomorrow_cal1" 
                        
    imageMso="RecoverInviteToMeeting" 
                        
    label="Tomorrow" 
                        
    onAction="rxbut_Tomorrow"    
                        
    tag="rxgal_cal1"/>
            </
    gallery>
            <
    button id="butNextMonth_cal1" 
                    
    imageMso="OutlineDemote" 
                    
    onAction="rxbut_NextMonth" 
                    
    tag="rxgal_cal1"
                    
    screentip="Next Month"/>
            <
    button id="butNextYear_cal1" 
                    
    imageMso="OutlineDemoteToBodyText" 
                    
    onAction="rxbut_NextYear"  
                    
    tag="rxgal_cal1"
                    
    screentip="Next Year"/>
        </
    buttonGroup>
    </
    box
    To add further calendars, copy and paste the above and do a quick Find & Replace on "_cal1" to replace it with "_cal2", "_cal3", etc.

    There is a sub routine called "InitialiseCalendars", that needs changing for each calendar you add. Below is the routine as required for the screenshots above. It allows you to set the default date, the label, label visibilty, screentip and supertip per calendar. The default dates are required, everything else is optional.

    Code:
    Sub InitialiseCalendars()
    
    Const sKEY_CAL1 As String = "rxgal_cal1"
    Const sKEY_CAL2 As String = "rxgal_cal2"
    
        Set colDates = New Dictionary
        Set colCalendarLabels = New Dictionary
        Set colCalLabelVisible = New Dictionary
        Set colCalScreentips = New Dictionary
        Set colCalSupertips = New Dictionary
                
        'Set default Dates
        'The key must match the Ribbon ID for the gallery control that represents the calendar
        colDates.Add sKEY_CAL1, Date
        colDates.Add sKEY_CAL2, Date
    
        colCalendarLabels.Add sKEY_CAL1, "Start:"
        colCalendarLabels.Add sKEY_CAL2, "End:"
    
        colCalLabelVisible.Add sKEY_CAL1, True
        colCalLabelVisible.Add sKEY_CAL2, True
    
        colCalScreentips.Add sKEY_CAL1, "Start Date"
        colCalScreentips.Add sKEY_CAL2, "End Date"
    
        colCalSupertips.Add sKEY_CAL1, "The start date from which you want to run the report."
    
    End Sub
    Attached is the XLAM file example, I'd love you feedback on way to improve it.

    It hasn't been extensively tested and has only been tested on 2007 (SP2 I think).

    Dex
    Attached Files Attached Files

Similar Threads

  1. Test copy Activate Ribbon Tab In Excel 2007 2010 *
    By Excel Fox in forum Test Area
    Replies: 16
    Last Post: 01-22-2019, 05:05 PM
  2. Excel 2003 Classic Menu in Excel 2007-2010
    By Excel Fox in forum Classic Menu
    Replies: 7
    Last Post: 09-10-2014, 10:29 PM
  3. Replies: 1
    Last Post: 02-14-2013, 11:08 AM
  4. Replies: 1
    Last Post: 10-16-2012, 01:53 PM
  5. Add ribbon programmatically to Excel 2010 using VBA
    By heapifyman in forum Excel Ribbon and Add-Ins
    Replies: 6
    Last Post: 07-18-2011, 09:16 PM

Tags for this Thread

Posting Permissions

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