Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close the printer session

Status
Not open for further replies.

sal21

Programmer
Apr 26, 2004
434
IT
This macro start in autoopen.
It open 4 session.
After this operation is possible via VBA to close the printer session?

' La macro per layout viene eseguita quando l'utente
'seleziona l'apertura di un determinato layout. Questo file
'non dovrebbe essere modificato.

'
' Ripetere quanto segue per ciascuna sessione di layout
'
' <nome file> = nome del documento sessione

Sub Main()

Dim System As Object
Dim Sessions As Object
Dim QPads As Object
Dim QPad As Object
Dim Session1 As Object
Dim Session2 As Object
Dim Session3 As Object
Dim Session4 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions= System.Sessions

Sessions.CloseAll


Set Session1 = Sessions.Open ("C:\PROGRAMMI\ATTACHMATE\E!E2K\SESSIONS\CL151F4500_A.EDP")
Set QPads = Session1.QuickPads
QPads.HideAll
Session1.Top = -1' Coordinate dello schermo
session1.Left = -1' Coordinate dello schermo
Session1.WindowState = xMAXIMIZED' Window state: xNORMAL, xMAXIMIZED, xMINIMIZED
Session1.Visible = 1' TRUE = Show window, FALSE = Hide window

Set Session2 = Sessions.Open ("C:\PROGRAMMI\ATTACHMATE\E!E2K\SESSIONS\CL151F4500_B.EDP")
Set QPads = Session2.QuickPads
QPads.HideAll
Session2.Top = -1' Coordinate dello schermo
session2.Left = -1' Coordinate dello schermo
Session2.WindowState = xMAXIMIZED' Window state: xNORMAL, xMAXIMIZED, xMINIMIZED
Session2.Visible = 1' TRUE = Show window, FALSE = Hide window

Set Session3 = Sessions.Open ("C:\PROGRAMMI\ATTACHMATE\E!E2K\SESSIONS\CL151F4500_C.EDP")
Set QPads = Session3.QuickPads
QPads.HideAll
Session3.Top = -1' Coordinate dello schermo
session3.Left = -1' Coordinate dello schermo
Session3.WindowState = xMAXIMIZED' Window state: xNORMAL, xMAXIMIZED, xMINIMIZED
Session3.Visible = 1' TRUE = Show window, FALSE = Hide window

Set Session4 = Sessions.Open ("C:\PROGRAMMI\ATTACHMATE\E!E2K\SESSIONS\CL151F4500_PRT.EPP")
Set QPads = Session4.QuickPads
QPads.HideAll
Session4.Top = 143' Coordinate dello schermo
session4.Left = 140' Coordinate dello schermo
Session4.Width = 545' Larghezza schermo in pixel
Session4.Height = 239' Altezza schermo in pixel
Session4.WindowState = xNORMAL' Window state: xNORMAL, xMAXIMIZED, xMINIMIZED
Session4.Visible = 1' TRUE = Show window, FALSE = Hide window

End Sub
 
What printer session? I don't see a printer session opened.

calculus
 
Set Session4 = Sessions.Open ("C:\PROGRAMMI\ATTACHMATE\E!E2K\SESSIONS\CL151F4500_PRT.EPP")
Set QPads = Session4.QuickPads
QPads.HideAll
Session4.Top = 143' Coordinate dello schermo
session4.Left = 140' Coordinate dello schermo
Session4.Width = 545' Larghezza schermo in pixel
Session4.Height = 239' Altezza schermo in pixel
Session4.WindowState = xNORMAL' Window state: xNORMAL, xMAXIMIZED, xMINIMIZED
Session4.Visible = 1' TRUE = Show window, FALSE = Hide window

 
1) you intend session4 not sess4
2) but to insert this command in a vba macro is possible?
For example:
Sub Main()

Dim System As Object
Dim Sessions As Object
Dim QPads As Object
Dim QPad As Object
Dim Session4 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions= System.Sessions

Session4.Close

End Sub
 
Yes, it should work. I've seen some examples of certain methods not working depending on the version of Extra that you are using.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top