Export Host Screen To Word Document
.ZMC
This macro will export the current PASSPORT screen to a new Word Document where each row of the host screen is placed into a new row within the document. The user may then save the file as needed.
' This macro exports the current screen to a new Word Document.
Sub ZMain
' Create the Word objects
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add
Set objRng = objDoc.Bookmarks("\endofdoc").Range
objWord.Visible = true
Call Word_log (objLine, objRng)
End Sub
' Subroutine to export the host screen data
Sub Word_log (objLine, objRng)
For i = 1 to 24
objLine = GetString (i, 1, 80)
objRng.InsertAfter objLine
objRng.InsertAfter vbCRLF
Next
End Sub |
The above example is designed to work with a TN3270 Model 2 screen (24 rows x 80 columns). If you require this functionality for other screen sizes, you must modify the For Next loop statement to match the number of rows and the GetString statement to match the number of columns.