9 replies
by arjei Accepted solution
by slayer_ Accepted solution
But you will need to be an expert in VBA.
You will have to use a combination of sendmessage (or postmessage) API calls, and the sendkeys command to send your data to a live web page.
by arjei Accepted solution
by slayer_ Accepted solution
there are several ways. First to decide, do you want to do it thru access or a VB6 program?
Second, how do you want this to be triggered? Keep in mind you can only type to what you can see. The easiest way, send keys, would rely on everything on screen being the same every time, and that your cursor was at the same position every time, and that the browser window is in focus.
If it were me, I would make a timer that checks for a key press, say F12, when detected, it would run through a sseries of send keys commands, based on text from the database. The user would have to be sure they have the browser window in focus at the time, and their cursor in the correct box.
Would this solution be acceptable to you?
by arjei Accepted solution
by slayer_ Accepted solution
First, what browser do u want to use?
Let's assume for now your using IE
call shell("iexplore.exe http://www.google.ca")
that line of code will fire up internet explorer and pass it googles web address. However, that line of code does not "Wait" for IE to launch, it just sends the command to the system. There is no good way to wait for a program to launch. I have done it using getwindow commands, and I would just loop them until it finds a window. Once the window is found, assumably the program is running. But even then, there would be no way to tell when the web page was loaded. A sleep command would be best for that, just sleep it for, maybe 5 seconds after it knows the browser is loaded.
code to describe how I said I check for open programs would look like this. *next post, for clairity*
by slayer_ Accepted solution
Option Explicit
Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String)
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
sub main 'or whereever u want this
dim h1 as Long
dim h2 as long
do while h1& = 0& 'search for as long as it is not found
call doevents 'Allow windows to do other stuff, rather than crazy looping
h1& = FindWindow("IEFrame", "Google - Windows Internet Explorer") 'Look for the IE window on the correct page, if not found, returns 0, thus loop again
loop
'Give it a moment to let the page open
call sleep(5000) '5 second wait.
'now check if the window you found, is actually the one in focus
h2& = GetForegroundWindow
if h1& = h2& then
'we're good, do what you need to do
else
'it's open, but its not up front, send keys won't work
end if
end sub
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending