Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Ribbon Calendar DatePicker Word 2007-2010

  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

  2. #22
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi Dex,

    Welcome to ExcelFox !!!



    Working fine in Xl 2010 on Win 7.

    Thanks for sharing !
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #23
    Junior Member
    Join Date
    Aug 2013
    Posts
    9
    Rep Power
    0
    Not a problem, thanks for testing it

  4. #24
    Junior Member
    Join Date
    Aug 2013
    Posts
    19
    Rep Power
    0
    it is great .... really helpful

  5. #25
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Wow! Dexter, this is simply awesome. I didn't realize you had gone ahead and put together a much better gallery based calendar. Here's my attempt a few months before at http://www.excelfox.com/forum/f10/ri...07-2010-a-575/

    Clearly you've given it a bit more thought than me (I'll probably use your Ribbon Calendar, or shamelessly steal some of your idea).
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

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
  •