Results 1 to 4 of 4

Thread: automating problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post

    How can i code a program that detects if the computer is connected to the internet, and if not dials a connection.... and then goes to outlook express (already open) and runs the option "tools/send and receive/send and receive all" (shortcut <ctrl c>).

    thanks,

    Dan

  2. #2
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    I believe you need to set your connection properties to "Dial Automatically". Then, when Outlook is told to send the message, it will look to see if there is a connection. If there isn't one, it should start one. If you don't have the connection set to Dial Automatically, you will get the Dial-Up connection dialog box which will wait until you hit "Connect".

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post automation

    thanks for that, but it won't work for what i want. I keep getting disconnected from my ISP, and so i can't leave my computer to download newsgroups etc. so i want it to detect if a connection has been dropped, redial and connect it again and then start downloading from the newsgroups again, without me needing to be there looking over it all the time.

    thanks,

    Dan

  4. #4
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Post Here's the first part:

    Hi Dan.

    This code will detect if you are connected to the Internet:
    Code:
    Option Explicit
    Public Declare Function InternetGetConnectedState _
    Lib "wininet.dll" (ByRef lpSFlags As Long, _
    ByVal dwReserved As Long) As Long
    
    Public Const INTERNET_CONNECTION_LAN As Long = &H2
    Public Const INTERNET_CONNECTION_MODEM As Long = &H1
    
    Public Declare Function InternetGetConnectedState _
    Lib "wininet.dll" (ByRef lpSFlags As Long, _
    ByVal dwReserved As Long) As Long
    
    Public Function Online() As Boolean
        'If you are online it will return True, otherwise False
        Online = InternetGetConnectedState(0& ,0&)
    End Function
    Do a search of VB-World and you should be able to find an example of using a Dial-Up Connection through VB Code.

    All the best.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width