Microsoft KB Archive/275496

= WD97: How to Change the Default Starting Day for the Week in the Calendar Wizard =

Article ID: 275496

Article Last Modified on 1/29/2007

-

APPLIES TO


 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q275496





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 of the week by modifying the existing code of the Calendar Wizard.

For additional information about how to install the Calendar Wizard, click the article number below to view the article in the Microsoft Knowledge Base:

155945 WD97: Additional Word Templates Available in ValuPack Folder

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:

173707 OFF97: 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\Other Documents

NOTE: This location may be different on your system, depending on where you installed the Calendar Wizard. On the Tools menu, point to Macro and 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) 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.</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: wd97 calender weekday

Keywords: kbdtacode kbhowto kbinfo kbmacroexample KB275496

-

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

© Microsoft Corporation. All rights reserved.