Chinacat55
Technical User
Good day,
I'm writing a macro in Extra to pull data from Extra and input it to specific fields in Word. So far I have collected the data as Strings and opened the Word doc. I'm having trouble specifying the location in Word where I want the data to go.
In this example, I want to put sCustdata(1) into the Word field that begins at page 1, line 8, column 14. Is there a way to specify this location?
I have searched this forum but I haven't been able to find this.
Thanks in advance for any assistance. This forum has been extremely helpful.
*********************************************************
' Declare Object Variables
Dim objApp As Object
Dim objDoc As Object
Dim objRange As Object
Dim oElements As Object
Dim objDoc1 As Object
Dim MyPage AS Object
Dim MyOutput$
Dim sCustdata(1) As String
Dim MyScreen As Object
Set MyScreen = Sess0.Screen
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sCustdata(1) = MyScreen.GetString(7,21,10) 'Extra TXN #
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
On Error Resume Next
Set objApp = GetObject(, "Word.Application.8")
If objApp Is Nothing Then
Set objApp = CreateObject("Word.Application.8")
If objApp Is Nothing Then Exit Sub
End If
objApp.Visible = True
set objdoc= objapp.Documents.Open("C:\Documents and Settings\ALLUSER\Desktop\backscan_coversheet.doc")
End Sub
********************************************************
I'm writing a macro in Extra to pull data from Extra and input it to specific fields in Word. So far I have collected the data as Strings and opened the Word doc. I'm having trouble specifying the location in Word where I want the data to go.
In this example, I want to put sCustdata(1) into the Word field that begins at page 1, line 8, column 14. Is there a way to specify this location?
I have searched this forum but I haven't been able to find this.
Thanks in advance for any assistance. This forum has been extremely helpful.
*********************************************************
' Declare Object Variables
Dim objApp As Object
Dim objDoc As Object
Dim objRange As Object
Dim oElements As Object
Dim objDoc1 As Object
Dim MyPage AS Object
Dim MyOutput$
Dim sCustdata(1) As String
Dim MyScreen As Object
Set MyScreen = Sess0.Screen
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sCustdata(1) = MyScreen.GetString(7,21,10) 'Extra TXN #
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
On Error Resume Next
Set objApp = GetObject(, "Word.Application.8")
If objApp Is Nothing Then
Set objApp = CreateObject("Word.Application.8")
If objApp Is Nothing Then Exit Sub
End If
objApp.Visible = True
set objdoc= objapp.Documents.Open("C:\Documents and Settings\ALLUSER\Desktop\backscan_coversheet.doc")
End Sub
********************************************************