microsoft.com Home | |||
http://www.microsoft.com/office/ork |
When a user clicks the custom button in an error message box, an Active Server Pages (ASP) page responds by displaying the Web page you created to provide information about the error. The ASP page directs the request sent when the user clicks the custom error button in the error message box.
Tip ASP pages are designed to run on the Microsoft Windows® operating system. For optimal performance, use Windows NT Server version 4.0 or later and Internet Information Server (IIS).
There are three ways to produce the ASP script. You can:
This method is the quickest and easiest way to create an ASP page. However, it doesn’t allow complete customization and cannot handle large numbers of error messages. You need Excel 97 or later to use the ASP generator.
This method requires knowledge of ASP scripting and Visual Basic Scripting Edition. It allows for complete customization, but it requires development time.
Toolbox The Office Resource Kit includes a file called ASPscrpt.xls to help you create your ASP script. Use this ASP generator to create the ASP file to handle your custom error messages. For information about installing this file, see Customizable Alerts.
The quickest way to create an ASP page is to use the ASP generator (ASPscrpt.xls). The template requires information about each error message you are going to customize. After entering this information, you run the macro and it creates the ASP script for you.
To use the ASP generator, you need the following:
To generate an ASP file
The default Web page is a generic page used to handle all error messages that do not have a unique Web page assigned to them.
Be sure to specify the correct URL of the Web pages that you want to link to the custom error message box.
The new ASP file is created and stored at the location you specified.
You can also implement custom error messages by modifying a sample ASP script. The following ASP code from the sample file Alert.asp handles four custom printer-related error messages:
<% response.expires=0
alertNum=""&request.queryString("alrt")
LCID=request.queryString("HelpLCID")
GUID=request.queryString("GUID")
select case (alertNum & "GUID" & LCID)
case "197573{11111111-1111-1111-1111-111111111111}1033"
response.redirect("http://helpdesk/office9alerts/printer.htm")
case "197574{11111111-1111-1111-1111-111111111111}1033"
response.redirect("http://helpdesk/office9alerts/printer.htm")
case "197575{11111111-1111-1111-1111-111111111111}1033"
response.redirect("http://helpdesk/office9alerts/printer.htm")
case "197576{11111111-1111-1111-1111-111111111111}1033"
response.redirect("http://helpdesk/office9alerts/printer.htm")
case else
response.redirect(http://helpdesk/office9alerts/FAQ.htm)
end select %>
To modify this sample script to work for your custom error messages, open the file in Microsoft FrontPage or another ASP editor and substitute the highlighted variables with your own values.
Toolbox The Office Resource Kit includes sample ASP scripts and HTML files to help you create custom error messages. Create your own ASP scripts and HTML files based on the files Alert.asp, Alert.htm, Alert2.asp, Alert2a.asp, and NYI.htm. For information about installing these files, see Customizable Alerts.
The following values and variables are used in the sample ASP scripts:
Error Message ID The number to the immediate right of the word case
is the error message ID number.
GUID The 32-character number to the right of the error ID number is the globally unique identifier (GUID). The ASP uses this number to determine which application to associate the error message with. There is only one GUID for each application.
Country Code The number following the GUID is the country code. This number is used to identify the locale of Office 2000.
Response Redirect This variable specifies the Web page associated with the error message.
All of the error messages in this sample script refer to the same Web page. You can easily assign different Web pages to each error by specifying other URLs. You can also add more error messages by repeating the case
string.
Note Two additional sample scripts, Alert2.asp and Alert2a.asp, provide examples of how you can extend the functionality of the ASP page. Alert2.asp prompts the user to enter an explanation of the problem that generated the error. After the user types their feedback and clicks Submit, they are redirected to Alert2a.asp which contains a message thanking them for their feedback.
You can write your own ASP page by using Visual Basic Scripting Edition or JavaScript, both of which are supported by Windows NT Server and IIS. When you write your own ASP page, you can add additional functionality beyond helping users out of an error message box. A custom ASP script can take the variables it receives from the custom error message and reuse the information in new contexts.
For example, a custom ASP script can generate dynamic HTML or redirect a browser to go to a different page, depending on the values sent to the ASP script from the browser. It can also capture the values from an error message and write them to a log file. A network administrator can use the log file to help solve common network problems.
You can use Visual Basic Scripting Edition or JavaScript to create your own ASP page. The IIS Web site contains links to a large number of additional resources that can help you to start working with these scripting languages, as well as reference information useful to more advanced scriptwriters. For more information, go to the Microsoft Windows NT Server Web Services site at http://www.microsoft.com/ntserver/web/.
Topic Contents | Previous | Next | Top Friday, March 5, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of use. | ||
License
|