There is a solution for the managed application mode. You can use GetWindows() function to enumerate the opened windows and then check in some way if this window contains the printed form. For example you can add a caption part “PrintedForm” for all windows with printed forms.
The part of the printed form generation code:
Code |
---|
//{{_PRINT_WIZARD(Print)
Spreadsheet = New SpreadsheetDocument;
...
Spreadsheet.Show("PrintedForm");
//}}
The command to handle opened windows:
&AtClient
Procedure ProcessPrintedFormWindows(Command)
OpenedWindows = GetWindows();
For Each Window In OpenedWindows Do
WindowCaption = Left(Window.Caption, 11);
If WindowCaption = "PrintedForm" Then
// Your code here
EndIf;
EndDo;
EndProcedure |
This won't work in the Ordinary Application mode.