Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar setting 1

Status
Not open for further replies.

fpoirier

Programmer
Sep 12, 2003
6
CA
Hello,

I use the calendar control 10.0 (...\office10\mscal.ocx)

I would like to change the year drop list... I would like 10 choice drop list in place of the 5 by default.

ex: 1986,1987,1988,1989,1990 I would like to have 1986,1987,1988,1989,1990,1991,1992,1993,1994,1995 in the drop list choice...
It is possible to change the number of choice?

It is possible to reverse the sort order? ex:1990,1989,1998...

Thanks
Frank





 
More info...

I use VBA in Word. I use the calendar control to help the user on date entry. I would like to give more year choice on the select. By default the calendar control give 5 choices. I would like 10 choices. I would like also a reverse year sort (2004,2003,2002,2001...) if it is possible. If you need more info please reply to the message.

Thanks.
 
I am positive that you can't change these settings.





...but you could cheat...




how you do this would depend on where you want to use the calendar, but for an example I'll assume you have the calendar on a userform.

On your userform with a calendar control, add a dropdown combo. place the combo over the calendar control's year picker.
You can format the combo however you like

add code to the combo_change and callendar_newyear events to keep the callendar year in sync with the combo year

Alternatively, create a usercontrol that does that for you - if you have VB

P.S. you might want to consider using the monthview control - I find it much more flexible (and looks nicer)

SteveO
 
Hello SteveO
Thanks for your help. It's a very good idea. I will try it.

I have another problem. I discover that on some computer the calendar control don't exist at all and cause an aplication error... telling that control don't exist...

How can I install the Calendar control on computer that don't have it? I use the calendar control: c:\Program files\Microsoft office\Office10\mscal.ocx so I try to copy the ocx... reboot... but it doesn't show on the list. I will try to search the forum for anwser. It's the first time that I use the calendar control on a form... It's working on some of my computer... but not all.

Thanks, Merci.
 
You have to register it after copying. Something like this (in a console window):
regsvr32 "c:\Program files\Microsoft office\Office10\mscal.ocx"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I add the reference on each computer. In VBA on the Tools menu - Reference... (something like that because my version of VBA is in french) I browse to the mscal.ocx files and now is working well for all my users.
Thanks.
 
Hi fPoirier,

I've got a similair problem with working with the calendar tool. I have to make it work om 2000/2002/2003 (office-version)

Could you're solution work for my problem. I've got the same error on my computer.

What are the correct steps to take:
You take the OCX out of Office 10 en copy that to the other computer.
What's next?

Is what PHV said the correct path to register: regsvr32 "c:\Program files\Microsoft office\Office10\mscal.ocx" (or does this also change)

Do I have to make the reference in every computer or is it ok just to do this in the template?

Could you give me step by step you're sollution?

Regards,
Joost
 
Hello,


Q - What are the correct steps to take:
You take the OCX out of Office 10 en copy that to the other computer.
What's next?

A - I copy the OCX on every computer (10) and I made the reference one by one on each computer. I'am a Lotus Notes programmer... so VBA it's new for me... maybe a guru can tell us wath is the best awnser. I don't know a better way to do it. Maybe we can use the login script to copy and register the ocx. maybe we can the regsvr32 command in the script.

Q - Is what PHV said the correct path to register: regsvr32 "c:\Program files\Microsoft office\Office10\mscal.ocx" (or does this also change)

A - I don't know if this work... I will try it. because if this work then we can use a bath file to automate the process.

Q - Do I have to make the reference in every computer or is it ok just to do this in the template?

A - I am not sure if you can do it on a template... because the OCX was missing on the computer... so we probably have to copy it on the computer

Q - Could you give me step by step you're sollution?

A - Copy the file (source) to computer. All my computer is XP Pro with Office XP (2002)... so the OCX source's file is the same for all my computer. In your case you propably have to copy a different source base on your office version??? or you can copy the most recent version of the OCX file???

I started Word... then I started Visual Basic (ALT-F11) in visual basic menu I clik on Tools-Reference. I click on the browse button... and select ActiveX control OCX on the file type (down arrow) and browse to the mscal.ocx file path then click open. That's was my solution

I hope it will help you. But I would like an expert opinion to optimize or evaluate this solution.

Thanks.
Frank.
2)
 
Bonsoir Frans,

Thanks a bunch for answering this question…

I’ll try this, and lets hope someone will answer you’re question that these steps you took are the most efficient!

Merci,
Joost Verdaasdonk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top