PrintWin statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Prints an existing window. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

PrintWin [ Window window_id ][ Interactive ][ File output_filename ]
	[ Overwrite ] 

window_id is a window identifier.

output_filename is a string representing the name of an output file. If the output file already exists, an error will occur, unless the Overwrite keyword is specified.

Description

The PrintWin statement prints a window.

If the statement includes the optional Window clause, MapBasic prints the specified window or layout frame; otherwise, MapBasic prints the active window or layout frame.

The window_id parameter represents a window identifier; see the FrontWindow() function and the WindowInfo() function for more information about obtaining window identifiers.

To obtain the window identifier for a map frame in a Layout window, call the LayoutItemInfo() function with the LAYOUT_ITEM_INFO_WIN attribute.

If you include the Interactive keyword, MapInfo Pro displays the Print dialog box. If you omit the Interactive keyword, MapInfo Pro prints the window automatically, without displaying the dialog box.

Examples

Example 1

Dim win_id As Integer
Open Table "world" 
Map From world
win_id = FrontWindow()
'
' knowing the ID of the Map window, 
' the program could now print the map by 
' issuing the statement: 
'
PrintWin Window win_id Interactive

Example 2

PrintWin Window FrontWindow() File "c:\output\file.plt"

See Also:

FrontWindow() function, Run Menu Command statement, WindowInfo() function