S
Steve
I'm using Office 2000 and 2003.
I've capture input from a user and then captured a window from another
application. I then insert the user's input into a document and then paste
the screen capture right after. However, the picture of the screen doesn't
show until the macro jumps to the end of the document. The operator needs to
see that everything was capture before collecting the next set of data. Any
suggestions how I could get the data to display. I wonder if I did a page
down and page up process. Does anyone know how to do a page up or page down
in VBA. Following is an extraction of the code. Any assistance would be
greatly appreciated. Thank you in advance.
One other item while I got your attention. Once I've written all the data
to the document I need to get the focus back to the inputbox window instead
of having the operator move the cursor to select it. Which is somewhat a
pain because it is on a laptop without a mouse. Any idea how to do this
because that window doesn't show up in task manager. Thanks again for any
and all assistance provided.
Sub testcapture()
Dim answer As String
Dim tasktitle As String
Dim firsttime As Boolean
template = "SurveyCaptureScreenTemplate"
tasktitle = "Windows Task Manager"
firsttime = True
Do
answer = InputBox("Enter color and associated number and then " & vbCr & _
"click ""Ok"" ONLY when you are ready to" & vbCr & _
"capture the screen" & vbCr & vbCr & _
"Type X to exit.", WindowTitle, , 1700, 400)
If (answer = "X") Then Exit Sub
If firsttime Then
firsttime = False
Else
Selection.InsertBreak Type:=wdPageBreak
Selection.EndKey unit:=wdStory
End If
answer = UCase(Mid(answer, 1, 1)) & Mid(answer, 2, ansrlen)
Selection.TypeText answer & vbCrLf
Tasks(tasktitle).Activate
Tasks(tasktitle).WindowState = wdWindowStateNormal
ScreenCapture
Selection.Paste
Selection.TypeText " " & vbCrLf
loop
End Sub
I've capture input from a user and then captured a window from another
application. I then insert the user's input into a document and then paste
the screen capture right after. However, the picture of the screen doesn't
show until the macro jumps to the end of the document. The operator needs to
see that everything was capture before collecting the next set of data. Any
suggestions how I could get the data to display. I wonder if I did a page
down and page up process. Does anyone know how to do a page up or page down
in VBA. Following is an extraction of the code. Any assistance would be
greatly appreciated. Thank you in advance.
One other item while I got your attention. Once I've written all the data
to the document I need to get the focus back to the inputbox window instead
of having the operator move the cursor to select it. Which is somewhat a
pain because it is on a laptop without a mouse. Any idea how to do this
because that window doesn't show up in task manager. Thanks again for any
and all assistance provided.
Sub testcapture()
Dim answer As String
Dim tasktitle As String
Dim firsttime As Boolean
template = "SurveyCaptureScreenTemplate"
tasktitle = "Windows Task Manager"
firsttime = True
Do
answer = InputBox("Enter color and associated number and then " & vbCr & _
"click ""Ok"" ONLY when you are ready to" & vbCr & _
"capture the screen" & vbCr & vbCr & _
"Type X to exit.", WindowTitle, , 1700, 400)
If (answer = "X") Then Exit Sub
If firsttime Then
firsttime = False
Else
Selection.InsertBreak Type:=wdPageBreak
Selection.EndKey unit:=wdStory
End If
answer = UCase(Mid(answer, 1, 1)) & Mid(answer, 2, ansrlen)
Selection.TypeText answer & vbCrLf
Tasks(tasktitle).Activate
Tasks(tasktitle).WindowState = wdWindowStateNormal
ScreenCapture
Selection.Paste
Selection.TypeText " " & vbCrLf
loop
End Sub