Microsoft KB Archive/275327

= WD2000: How to Change the Default Starting Day of the Week in the Calendar Wizard =

Article ID: 275327

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q275327





SUMMARY
When you create a calendar by using the Calendar Wizard in Microsoft Word, the starting day of each week is Sunday. However, you may want to create a calendar in which each week starts with a different day (for example, Monday).

This article explains how to change the default starting day in the Calendar Wizard by modifying the existing code of the Calendar Wizard.

NOTE: Microsoft does not support the modification of its wizards or templates. Modifications done by the user are at the user's risk and constitute no obligations or warranties, either written or expressed, by Microsoft.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:

212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

To change the starting day for each week of a calendar, follow these steps:  On the File menu, click Open and open the Calendar Wizard (Calendar Wizard.wiz).

By default, the Calendar Wizard.wiz template is located in the following folder:

C:\Program Files\Microsoft Office\Templates\1033

 On the Tools menu, point to Macro, and then click Visual Basic Editor. In the Project window, double-click the Calendar module. You may need to expand the Modules folder listed in the TemplateProject (Calendar Wizard) project.

NOTE: If the Project window does not appear, click Project Explorer on the View menu. On the Edit menu, click Find. In the Find What box, type iWeekStartDay and then click Find Next.  After iWeekStartDay is found, click Cancel.

The following macro code lines are found near the top of the macro: ' Localization Note: iWeekStartDay is the starting day of the week (Sun = 0, Mon = 1, ...Sat = 6) Public Const iWeekStartDay      As Integer = 0 </li>  To change the default starting day for your calendar, change the Integer value to one of the following:

For example, if you want your calendar week to begin on Monday, change the Integer value to 1, as in the following example: Public Const iWeekStartDay      As Integer = 1 </li> On the File menu, click Save Calendar Wizard.</li> On the File menu, click Close and Return to Microsoft Word to close the Visual Basic Editor.</li> On the File menu, click Close to close the Calendar Wizard.</li></ol>

Now, when you run the Calendar Wizard, your calendar week begins with the day that you specified in the macro.

Additional query words: vba modify change calender wizard start day weekday

Keywords: kbdtacode kbhowto kbmacroexample kbwordvba wd2000 KB275327

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.