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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull information to print labels

Status
Not open for further replies.

StarChip

IS-IT--Management
Jun 24, 2003
3
US
First off I am new to this, thank you in advance.

I was looking for a solution that would allow me to pull data from the screen to creat labels. I need data from 4 locations on the screen captured to the clipboard to be pasted into the label maker program window.

Does anyone have Extra macro code that I can paste needing minor modifications as to the location of the text looping until complete? I have found bits and pieces but cant get them to work together.

Thankx again
 
StarChip

Post what you have thus far and we'll see if we can help.

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


 
Here is what I have so far.

Some problems are:
1.Clipboard not cleared before macro started
2.Snapshot of complete line that may contain __ at the end
3.If line is blank skip it

Thank you for your help.

-----------------------------------------------------------
'--------------------------------------------------------------------------------
' This macro was created by the Macro Recorder.
' Session Document: "ADMIN.EDP"
' Date: Thursday, July 27, 2006 12:26:09
' User: brydavis
'--------------------------------------------------------------------------------

' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$

Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.Sessions

If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 3000 ' milliseconds

OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If

' Get the necessary Session Object
Dim Sess0 As Object
SessName0$ = "ADMIN.EDP"

Set Sess0 = Sessions.Item(SessName0$)
If Sess0 is Nothing Then
Err = MsgBox(SessName0 + " is not currently open. Open it?",1)
If 1 = Err Then
Err = 0
Set Sess0 = Sessions.Open(SessName0)
If Err Then
MsgBox("Failed to open " + SessName0 + ". Stopping playback")
Stop
End If
ElseIf 2 = Err Then
Stop
Else
MsgBox("Failed to open " + SessName0 + ". Stopping playback")
Stop
End If
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

' This section of code contains the recorded events

' Selecting the text at specific Row 8 Column 14 through Row 8 Column 18
' Example: Sess0.Screen.Select 8, 14, 8, 18

' Last Name
Sess0.Screen.Select 7, 15, 7, 37
' Copy and append it to clipboard
Sess0.Screen.CopyAppend

' First Name
Sess0.Screen.Select 9, 15, 9, 37
Sess0.Screen.CopyAppend
' Address 1

' Address 2

' City

' State

' Zip

System.TimeoutValue = OldSystemTimeout
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top