Microsoft KB Archive/238778

From BetaArchive Wiki

Article ID: 238778

Article Last Modified on 4/17/2006



APPLIES TO

  • Microsoft Outlook 2000 Standard Edition



This article was previously published under Q238778

SUMMARY

This article provides general information about installing and using the Microsoft Outlook XPrint ActiveX Control and XPrint Add-in.

MORE INFORMATION

The XPrint ActiveX Control and the XPrint Add-in allow you to print Outlook forms as they appear on the screen, WYSIWYG (what you see is what you get). You can use the control and the add-in separately, or you can use both at the same time.

Obtaining the XPrint Utility

The XPrint utility is available from the Microsoft Office 2000 Resource Kit Web site. This Web page provides general information about the XPrint utility:

You can download the XPrint utility from the Microsoft Office 2000 Resource Kit Web page:

To Install the XPrint Components

Setupex.exe is the self-extracting file that you can run, or download from the Office Resource Kit Web site.

IMPORTANT: The setup program does not detect where you have previously installed Microsoft Office. If Office was installed to a drive other than the C drive, be sure to use the drive Microsoft Office is located on.

The XPrint Add-in is Printform.dll, and is installed to C:\Windows\System. The XPrint ActiveX Control is XPrint.ocx, and is installed to

C:\Program Files\Microsoft Office\Office\Addins


by default. Documentation is provided in the XPrint.chm file, also installed in the Addins folder.

Deploying the XPrint Components

The Outlook XPrint ActiveX Control or XPrint Add-in must be installed on any computer that will be using either of these components. This includes all computers that will open an Outlook form that uses the XPrint ActiveX Control.

The simplest way to install the components on the client computers is to place the Setupex.exe file on a shared network file server, and then distribute a link to this file so that users can click the link to install the components.

Using Only the XPrint Add-in

Because the XPrint Add-in is a Microsoft Exchange Client Extension and not a COM Add-in, it can be used with all versions of Outlook. Once the add-in is installed, it replaces the default Print command on the File menu, for any custom mail message or post form. You should be aware of the following issues:

  • The add-in does not work with standard Outlook forms. The item must use a custom form definition for the custom Print window to appear.
  • To use the functionality provided by the XPrint Add-in, you must open a mail message or post form, click the File menu, and then click Print. The Print Preview command on the File menu is not affected by the add-in, nor are the Print or Print Preview commands on the main Outlook application, or folder, window.
  • You cannot use the add-in to print Contact, Task, Appointment, Journal, or Note forms. If you need to print these types of Outlook forms WYSIWYG, you must use the XPrint ActiveX Control.
  • The XPrint Add-in prints all customized form pages. Note that for one of the default pages of a mail message or post form to print, you must dirty the form page by nudging a control or making some other change to the page. If you only want one or a subset of pages to print, you must use the XPrint ActiveX Control.
  • Neither the XPrint ActiveX Control, or the XPrint Add-in are able to print a form's Message or Notes field. In addition, "recipient" fields such as To, Cc, and Bcc will not print. If you need to print these types of fields using the XPrint components, add a regular text box control to the form page, and then bind the text box control to the field you want to print. When using this approach, you will lose any rich text formatting in the Message or Notes field. Only the unformatted, plain text will appear in the text box.

Due to how the add-in is implemented and inherent limitations of using the add-in, using the add-in by itself is generally suggested only if you do not wish to integrate the ActiveX control into an existing custom Outlook form.

Using Only the XPrint ActiveX Control

While the XPrint ActiveX Control provides more functionality than the XPrint Add-in, it also requires that you have moderate experience with creating Outlook custom forms with Visual Basic Scripting Edition (VBScript).

To use the ActiveX control, create a custom form and place the control on the form page you want to print. Using VBScript, you must programmatically set some properties on the control to initialize it when the form is in run mode. This is typically done in the Item_Open event. Next, you need to determine how the user will initiate the printing process. This functionality would typically be included as part of a Click event for a command button control, but you can use any other Outlook events to determine when the form will print. For example, you can add the printing functionality to the Write event so that every time an item is saved with changes, the form will print automatically.

Example of Using the XPrint ActiveX Control

  1. Open a new contact.
  2. On the Tools menu, point to Forms, and then click Design This Form.
  3. On the Form menu, click Control Toolbox.
  4. If you have not added the XPrint control to the Control Toolbox, right-click the Toolbox and click Custom Controls. Scroll down to the bottom of the list of Available Controls, and select XPrint Control. Click OK.
  5. Drag the XPrint Control from the Control Toolbox onto the General page of the contact form. Note that it does not matter where you place it, since the control will not display when the form is in run mode.
  6. Click the P.2 page of the form.
  7. Using the Control Toolbox, add a command button control to the P.2 page of the form.
  8. Right-click the command button and then click Properties. On the Display tab, set the Name to cmdPrint, and the Caption to Print. Click OK. Close the Control ToolBox.
  9. On the Form menu, click View Code. Enter the following VBScript code into the Script Editor and then close the Script Editor:

    Dim objInsp
    Dim objPage1
    Dim objXPrint1
    
    Function Item_Open()
       Set objInsp = Item.GetInspector
       Set objPage1 = objInsp.ModifiedFormPages("General")
       Set objXPrint1 = objPage1.XPrint1
       objXPrint1.Preview = True
       objXPrint1.Controls = objPage1.Controls
    End Function
      
    Sub cmdPrint_Click()
       objXPrint1.PrintForm
    End Sub
                        
  10. On the Tools menu, point to Forms, and then click Publish Form. The default is to store the Contact form in your Contacts folder. Type XPrint Test as the Display Name, and then click Publish.
  11. Close and do not save changes to the form.

To test the form, follow these steps:

  1. Click the Actions menu, and then click New XPrint Test.
  2. Click the P.2 page of the contact form.
  3. Click the Print button on the form.

The first page of the contact form should preview on the screen in a WYSIWYG format. Notice that the Notes field is not on the printout.

Using the XPrint ActiveX Control and Add-in Together

When you use the XPrint Active Control while the XPrint Add-in is installed, you can use the control's AutoPrint property to determine whether the XPrint control, or add-in will determine how the form is printed. For more information, consult the XPrint.chm help file that is installed by setup.

REFERENCES

For additional information about other methods you can use to create custom printouts based on Outlook forms, please see the following article in the Microsoft Knowledge Base:

230512 OL2000: Outlook Does Not Print Forms as Expected


For additional information about available resources and answers to commonly asked questions about Microsoft Outlook 2000 solutions, please see the following article in the Microsoft Knowledge Base:

146636 OL2000: Questions About Custom Forms and Outlook Solutions



Additional query words: OutSol OutSol2000 OL2K

Keywords: kbinfo KB238778