How do I send info to another program with Visual Basic 6?

Posted on 2009-04-26
Last Modified: 2012-05-06
Okay, is it possible to...
-open a internet window
-send text to a text box in the window
-press a command button in the window
-reload the window to a URL

Please answer one or all the questions.

Question by:IrTeh1337
    LVL 14

    Accepted Solution

    Using sendkeys etc. does not give a sure results but You need to use own webbrowser control in this if it will due:
    It's very similar in VB 6 this one is asked in .NET but it's on VB 6 area

    In my frist comment there is a sbmit button click on that browser object.


    Author Comment

    Okay, I am trying to create a auto-log in--just like the example you gave.
    Look at the code snippet,
    Is it possible to use a web control to...
    put text in the text box and then click the command button?
    If that is any way possible with vb6 please reply.
    It's JavaScript fyi.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
            <META http-equiv="Expires" content="0"/>
            <META http-equiv="pragma" content="no-cache"/>
            <META http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
            <META name="Expires" content="0"/>
            <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
            <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon"/>
            <link rel="stylesheet" type="text/css" href="/reportCard/stylesheet.css"/>
        <title>PTSD Report Cards</title>
        <script type="text/javascript">
            function trapEnterKey(evt)
                var keycode;
                //noinspection StatementWithEmptyBodyJS
                if (evt)
                else if (window.event)
                    evt = window.event;
                else if (event)
                    evt = event;
                    return true;
                if (evt.charCode)
                    keycode = evt.charCode;
                else if (evt.keyCode)
                    keycode = evt.keyCode;
                else if (evt.which)
                    keycode = evt.which;
                    keycode = 0;
                if (keycode == 13)
                    return false;
                    return true;
    <body onload="document.forms[0].elements['loginForm:userNameInput'].focus();" onkeypress="trapEnterKey(event);">
      <script type="text/javascript">var _AdfWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.';</script><script type="text/javascript" src="/reportCard/adf/jsLibs/Common1_0_7.js"></script><form id="loginForm" name="loginForm" method="POST" onkeypress="return _submitOnEnter(event,'loginForm');" action="/reportCard/pages/login.jsf">
      <table border="0" cellpadding="3" cellspacing="3" class="panel"><tbody><tr><td><img src="/reportCard/images/ptsdLogo.jpg" alt="Welcome to Mayet Report Cards" title="Welcome to PTSD Report Cards"></td></tr>
    <tr><td><table align="CENTER" border="0" cellpadding="3" cellspacing="3" class="panel"><tbody><tr><td><table border="0" cellpadding="5" cellspacing="3">
    <thead><tr><th class="login-heading" scope="colgroup" colspan="3">
    PTSD Report Cards
    <tr><td><label class="label" for="loginForm:userNameInput"><span class="label">Enter your user name:</span></label></td><td><input id="loginForm:userNameInput" name="loginForm:userNameInput" type="text" value="" maxlength="30" size="20" class="textField" tabindex="0"></td><td></td></tr>
    <tr><td><label class="label" for="loginForm:passwordInput"><span class="label">Password:</span></label></td><td><input type="password" id="loginForm:passwordInput" name="loginForm:passwordInput" maxlength="20" size="20" class="textField"></td><td></td></tr>
    <tr><td></td><td><input id="loginForm:loginButton" name="loginForm:loginButton" type="submit" value="Login" onclick="submitForm('loginForm',1,{source:'loginForm:loginButton'});return false;" class="button"></td><td></td></tr>
    <input type="hidden" name="org.apache.myfaces.trinidad.faces.FORM" value="loginForm"><span id="tr_loginForm_Postscript"><input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE" value="!8c2b464"><script type="text/javascript">function _loginFormValidator(f,s){return _validateInline(f,s);}var loginForm_SF={};</script></span><script type="text/javascript">_submitFormCheck();</script></form>

    Open in new window


    Author Closing Comment

    Yeah I used the link for the code. Happy: :P

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now