Академический Документы
Профессиональный Документы
Культура Документы
need:
Create a form with a lable over a textbox, make the textbox multi-line, and stick 3 command buttons
on the form. Don't rename any of them - the program expects the defaults of label1, text1,
command1, command2, command 3
The following CODE is the complete FORM CODE to copy/paste into it. Any questions/claifications
required for the code, ask away...
===========
Option Explicit
Public TargetIE As SHDocVw.InternetExplorer
Private Sub Command1_Click() ' Send text to first IE-document found
GetTheIEObjectFromSystem
SendTextToActiveElementWithSubmitOptionSet (False)
End Sub
Private Sub Command2_Click() ' Send text to IE-document containing EE thread
GetTheIEObjectFromSystem ("Q_26773800")
SendTextToActiveElementWithSubmitOptionSet (False)
End Sub
Private Sub Command3_Click() 'submit text to IE-document containing EE-thread
GetTheIEObjectFromSystem ("Q_26773800")
SendTextToActiveElementWithSubmitOptionSet (True)
End Sub
Private Sub Form_Load()
Me.Label1.Caption = "Text to send"
Me.Text1 = "This is a sample text message set and submitted programmatically"
'make text1 multiline in design
Me.Command1.Caption = "Text to the first IE browser document found"
Me.Command2.Caption = "Text to the EE-thread browser window"
Me.Command3.Caption = "Submit text to the EE thread browser target"
End Sub
Public Sub GetTheIEObjectFromSystem(Optional ByVal inurl As String = ".") '
will be found in ALL browser URLs
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer
Dim Doc As Object
For Each IE In SWs
"."