FP: How to Add a Script to the ActiveX Calendar Control

Last reviewed: March 18, 1998
Article ID: Q164620
The information in this article applies to:
  • Microsoft FrontPage 98 for Windows
  • Microsoft FrontPage 97 for Windows with Bonus Pack

SUMMARY

The ActiveX Calendar Control provides a way of displaying calendar-related events on a Web. ActiveX Controls may be combined to add greater functionality to your Web pages than would be possible with a single control.

MORE INFORMATION

ActiveX Controls are a suite of products and technologies that support Web development and enable software components to interact with one another. ActiveX Controls are built on the Component Object Model.

For more information about ActiveX Controls, please see the following Microsoft World Wide Web site:

   http://www.microsoft.com/activex/gallery

For more information about Visual Basic Scripting, please see the following Microsoft World Wide Web site:

   http://www.microsoft.com/vbscript

The following example displays the date you selected in a message box.

Microsoft FrontPage 98

  1. Open a Web page in the FrontPage Editor.

  2. On the Insert menu, point to Advanced, and then click Script.

  3. Click VBScript, and then click OK.

  4. On the Insert menu, point to Advanced, and then click ActiveX Control.

  5. In the Pick a Control list, click Calendar Control.

  6. In the Name box, type the name you want to use for this control. For example, type "Calendar1" (without the quotation marks).

  7. Click OK.

  8. Right-click the calendar control object, and then click Script Wizard.

    The Script Wizard appears. It is divided into three panes: the Event pane (left side), the Action pane (right side), and the Script pane (bottom).

  9. In the Script Wizard dialog box, click Code View.

  10. In the Event pane, double-click the Calendar1 icon. Select the Click event.

  11. In the Action pane, double-click the Window icon. Double-click the Alert icon.

    The following code appears in the Script pane:

           Sub Calendar1_Click()
           call window.alert(msg)
    
    

  12. In the Script pane, delete "msg" (without the quotation marks). With the insertion point between the parentheses, double-click the Calendar1 icon in the Action pane, and then double-click Value. The code should now look like this:

           Sub Calendar1_Click()
           call window.alert(Calendar1.Value)
    
    

  13. Click OK.

Microsoft FrontPage 97

  1. Open a Web page in the FrontPage Editor.

  2. On the Insert menu, click Script.

  3. Click VBScript, and then click OK.

  4. On the Insert menu, point to Other Components, and then click ActiveX Control.

  5. In the Pick a Control list, click Calendar Control.

  6. In the Name box, type the name you want to use for this control. For example, type "Calendar1" (without the quotation marks).

  7. Click OK.

  8. Right-click the calendar control object, and then click Script Wizard.

    The Script Wizard appears. It is divided into three panes: the Event pane (left side), the Action pane (right side), and the Script pane (bottom).

  9. In the Script Wizard dialog box, click Code View.

  10. In the Event pane, double-click the Calendar1 icon. Select the Click event.

  11. In the Action pane, double-click the Window icon. Double-click the Alert icon.

    The following code appears in the Script pane:

           Sub Calendar1_Click()
           call window.alert(msg)
    
    

  12. In the Script pane, delete "msg" (without the quotation marks). With the insertion point between the parentheses, double-click the Calendar1 icon in the Action pane, and then double-click Value. The code should now look like this:

           Sub Calendar1_Click()
           call window.alert(Calendar1.Value)
    
    

  13. Click OK.

When you view the page in a Web browser that supports ActiveX controls and you click a date on the calendar, a message box appears.


Additional query words: scripting controlling active x
Keywords : fpedit fpscript kbcode kbusage kbdta
Version : windows:97,98
Platform : WINDOWS
Hardware : x86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 18, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.