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!

Screen printing Attachmate

Status
Not open for further replies.

Ebenezum

Programmer
Sep 14, 2006
12
US
I have a module in Access that screen scrapes and enters data in Extra! Enterprise 7.1a. I cannot seem to find the command to print the current screen. I even tried setting a shortcut key to print and then using the sendkey command but it still does not work. Does anyone know how I can accomplish?
Thank you for the help.
 
OBJscreen.SendKeys("<PrintRange>")


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks, but that does not work either.
It actually puts <PrintRange> on the command line.
I tried to put an enter in there and I get a CL002 unknown command.
I used Sess0.Screen.SendKeys ("<PrintRange>")
 
Sess0.sendkeys ("<printrange>")
sorry I was mistaken with the screen obj.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
It still does not work. I have tried everything without any luck. Do you know of any other way to just send the current screen to the printer?
 
Try this to print a screen
Code:
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
Are you coding in VBA through Access or using EB through Extra?

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I saw this before but my network printer uses an IP address not a network name. Any hope there?

I am coding in VBA through Access.

Also, thanks for all your help.
 
Sess0.Screen.SendKeys ("<PrintScreen>") ???


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
You may try asking the question in forum705 as your scripting in VBA. It's easy enough to Scrape the screen with a screen.area.txt so maybe someone there can give you an easy way to print text directly to the printer.

Sess0.Screen.SendKeys ("<PrintScreen>") prints my current screen in Extra, I'm calling the screen object in Extra Basic but that shouldn't make a diff.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
CautionMP said:
Ebenezum,
In version 7.0 you use ExtraSession.PrintDisplay

Thanks CMP
star.gif


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top