Placing the Control in an Office Document or on a Web Page

Integration of the Microsoft Office applications with Visual Basic for Applications makes the process of adding the System Monitor control almost identical across these applications. The following procedures describe how to insert the control in applications such as Microsoft Word, Microsoft Excel, and Microsoft PowerPoint®. For purposes of this section, the word "document" is used to refer to PowerPoint slides, Word documents, or Excel spreadsheets.

  • Default key settings in Microsoft Word might conflict with the CTRL+H combination used for System Monitor highlighting. You might need to change these to support highlighting when the System Monitor control (Sysmon.ocx in the systemroot\System32 folder) is used in Microsoft Word.

In addition, you can add the control to a Web page using an HTML editor that supports insertion of ActiveX controls or using a text editor as described in "To insert the control in an HTML Page."

To insert the System Monitor control into a Microsoft Office application

  1. Start the application and select Toolbars under the View menu.
  2. Under Toolbars, select Control Toolbox.
  3. With the Control Toolbox displayed, click the More Controls icon and select the System Monitor Control.

figure 5.17 system monitor control in the control toolbox
Enlarge figure

Figure 5.17 System Monitor Control in the Control Toolbox

Figure 5.17 shows the System Monitor control selected in the Control Toolbox.

  1. Place the control on the page according to the requirements of the application. See the following differences among applications:
    • In a Microsoft Word document, select the insertion point (where the I-beam is flashing) before selecting the control. The control will appear at the position you selected. Design mode is active and you need to exit Design mode before setting control properties or adding counters. Click the Design Mode icon to exit.
    • In a Microsoft Excel spreadsheet, select the control and then select the insertion point. When the crosshair appears, note that you can create a placeholder for the control by holding down the left mouse button and dragging the mouse pointer across the columns and rows that you want the control to occupy. Releasing the mouse button causes the control to appear in the space you selected.

    If you do not create a placeholder, you can click any location on the spreadsheet and the control will be inserted in the location with a default size. Design mode is active and you need to exit Design mode before setting control properties or adding counters. Click the Design Mode icon to exit.

    • In a Microsoft PowerPoint slide, select the control and then select the insertion point. With the crosshair visible on the screen, note that you can hold down and drag the mouse button to the size you want and the control will be inserted in the placeholder. Otherwise, you can click anywhere on the slide to place the control in that location with a default size and you can modify the size coordinates later (as described in "To format the control in a document").

    The Design mode icon is not displayed after you insert the control although Design mode is in effect. To exit Design mode, on the View menu, click Slide Show.


note-icon

Note

The System Monitor control is not displayed correctly until you exit Design mode.

With the control sited in the document, you can add counters or modify control properties, as described in the System Monitor Help file (Sysmon.chm).

If you select Graph for the Display Type and the size you define for the control is insufficient to show the graph data, only a portion of the graph will be displayed (such as the vertical minimum and maximum scale values, and the counter-data graph lines).

If you select Report for the Display Type and the size is insufficient to show all the report data, the control includes vertical and horizontal scroll bars so that you can scroll to view the data that does not fit in the display.

If you want to format the control in the application, resume Design mode by clicking the Design mode icon in the Control Toolbox and see the procedure named "To format the control in a document" later in this chapter.

To insert the control in a Microsoft Visual Basic program

  1. On the File menu, choose New to open a new project (such as a Standard EXE or an ActiveX Document EXE).
  2. On the Project menu, click Components to show the Components dialog box.

    You can also view the Components dialog box by right-clicking the Toolbox. If the Toolbox is not displayed, in the View menu, select the Toolbox command.

  3. Under Controls in the Components dialog box, select the System Monitor Control Library check box, and then click OK.

    An icon for the System Monitor control now appears in the Toolbox.

  4. With the form or the document displayed, double-click the System Monitor Control icon to add it to the form or document for your program.

    This places the control in the document, occupying the entire size of the form. If you want to select a size for the control, click the System Monitor Control icon once and then, when the crosshair appears, hold down and drag the mouse to the size you want the control to occupy on the form.

Immediately after inserting the control, the application is in Design mode, so you can format the control within a document. For more information, see the procedure "To format the control in a document" later in this chapter.

To insert the control in an HTML page

  • Using a text editor, create a page to include the control. To place the control on the page, insert the <OBJECT> tag and specify the class ID as follows:

<OBJECT classid="clsid:C4D2D8E0-D1DD-11CE-940F-008029004347">

</OBJECT>


This places the control in the document and, when you view the page in a Web browser, you can add counters or modify control properties as described in the procedures that appear later in this document.

To include functions in your page that automate the setting of properties or addition of counters, use scripts written in Visual Basic Scripting Edition (VBScript), or use Microsoft FrontPage®, as described in the following procedure.

To insert the System Monitor control into a Web page created with Microsoft FrontPage

  1. In a new or existing FrontPage Web page, on the Insert menu, select Other Components, and then select ActiveX Control.
  2. In the ActiveX Control Properties dialog box, select Sysmon Graph Control in the Pick A Control list box.
  3. To add VBScript, click Extended, and complete the Extended Attributes dialog box as needed.

    For more information about VBScript, see the VBScript link on the Web Resources page at http://windows.microsoft.com/windows2000/reskit/webresources.

© 1985-2000 Microsoft Corporation. All rights reserved.



Microsoft Corporation Staff, IT Professional Staff - Microsoft Windows 2000 Server Operations Guide
Microsoft Corporation Staff, IT Professional Staff - Microsoft Windows 2000 Server Operations Guide
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 404

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net