Groom84 - did you get your answer?
Here is the code from an Extra macro that takes fields from a screen and populates them into a Word document. I hope this helps.
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Declare Function MyFunction()
Sub Main
call MyFunction()
End Sub
Function MyFunction()
Dim wrd As Object
Dim Session As Object
Dim System As Object
Dim MyScreen as Object
Dim TextFound as String
Dim ClientID as String
Dim FirstName as String
Dim LastName as String
Dim StreetNumber as String
Dim StreetName as String
Dim StreetType as String
Dim StreetAPT as String
Dim City as String
Dim State as String
Dim Zip as String
Set System = CreateObject("EXTRA.System")
Set Session = System.ActiveSession
Set MyScreen = Session.Screen
'Scrape the data from the host screen.
ClientID = MyScreen.GetString(4,38,9)
FirstName = MyScreen.GetString(5,13,13)
LastName = MyScreen.GetString(5,53,18)
StreetNumber = MyScreen.GetString(12,10,12)
StreetName = MyScreen.GetString(12,23,22)
StreetType = MyScreen.GetString(12,46,7)
StreetAPT = MyScreen.GetString(12,54,10)
City = MyScreen.GetString(13,7,22)
State = MyScreen.GetString(13,34,2)
Zip = MyScreen.GetString(13,43,10)
'Format the Host text to use lowercase characters
FirstName = left(FirstName,1) + lcase(right(FirstName,len(FirstName)-1))
LastName = left(LastName,1) + lcase(right(LastName,len(LastName)-1))
StreetName = left(StreetName,1) + lcase(right(StreetName,len(StreetName)-1))
StreetType = left(StreetType,1) + lcase(right(StreetType,len(StreetType)-1))
City = left(City,1) + lcase(right(City,len(City)-1))
'Insert the host information into the MS Word document
Set wrd = CreateObject("Word.application")
wrd.Documents.Open "C:\Documents and Settings\All Users\Documents\FSET_CLASS_Attm.doc"
wrd.Visible = True
wrd.ActiveDocument.CustomerName.Caption= Trim(FirstName) & " " & LastName
wrd.ActiveDocument.CustomerAddress.Caption= Trim(StreetNumber) & " " & Trim(StreetName) & " " & Trim(StreetType) & Trim(StreetAPT)
wrd.ActiveDocument.CityStateZip.Caption= Trim(City) & ", " & Trim(State) & " " & Zip
wrd.ActiveDocument.Today.Caption= format (DATE, "mmmm dd, yyyy")
wrd.ActiveDocument.ClientID.Caption= Trim(ClientID)
Set wrd = Nothing
end Function