Performing Print, File, and Clipboard Operations

The WEB-BROWSER2 control includes special properties that allow users to perform standard Windows print, file, and clipboard operations from your COBOL application.

There are five special properties relating to the Windows Print function. They are designed to let users print the contents of the WEB-BROWSER2 control (i.e., the Web page that is being displayed). These are:

Special Property Function
PRINT Displays the Print dialog box

To display the Print dialog box so that users can choose a printer, page range, and so on, set the Print property equal to "1" as such:

display web-browser2 PRINT = 1.

In addition to the print properties, the WEB-BROWSER2 control has several special properties relating to the Windows file and clipboard operations. These are:

Special Property Function
COPY-SELECTION Copies current selection to clipboard
SELECT-ALL Selects the active HTML page, frame, or entry field, depending on cursor location
SAVE-AS Displays the "Save As" dialog
SAVE-AS-NO-PROMPT Saves frame contents to disk without prompting (for early version of IE only)

To copy the current selection to the clipboard, set the COPY-SELECTION property to "1" as shown below:

display web-browser2, COPY-SELECTION = 1.

For complete information on the WEB-BROWSER2 control special properties, see Special Properties

Note: The WIN$SHELLEXECUTE library provides functions for handling printing.