Global Sys As Object, Sess As Object, MyScreen As Object
'Global WshNetwork as Object,oPrinters as object, wshshell as object
Sub Main
'Set WshNetwork = CreateObject("WScript.Network")
'set WshShell = CreateObject("WScript.Shell")
'Set oPrinters = WshNetwork.EnumPrinterConnections
'For i = 0 to oPrinters.Count - 1 Step 2
'msgbox oPrinters.Item(i+1)
'Next
'using this to see what printers are available
'still not sure how to tell which one is the default printer
Dim rc%
Dim MaxColumn%
Dim row%
Dim MaxRows%
Dim filenum%
Dim Screenbuf$
Dim linebuf$
Dim FileName$
' Get the necessary Session Object
Set Sys = CreateObject("EXTRA.System") 'Assumes an open sessions
Set Sess = Sys.ActiveSession
Set MyScreen = Sess.Screen
If (Sess is Nothing) Then
Msgbox "Could not create the Session object."
STOP
End If
If Not Sess.Visible Then Sess.Visible = TRUE
Sess.Screen.WaitHostQuiet(g_HostSettleTime)
FileIn=FreeFile
MaxRows%=MySess.Rows()
MaxColumns%=MySess.Cols()
Screenbuf$=""
'Takes a "snapshot" of screen and stores it in variable Screenbuf$
For row%=1 to MaxRows%
Screenbuf$=Screenbuf$+MySess.getstring(row%,1,MaxColumns%)+Chr$(13)+Chr$(10)
Next
filenum%=Freefile
FileName$="FRC014p2584417" 'name of your network printer
Open FileName$ For Output as filenum%
Print # filenum%,screenbuf$; chr$(12) 'supposed to send the scrape to printer
Close filenum%
End Sub