Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get the state of an Inet control?

Posted on 2004-08-21
2
Medium Priority
?
504 Views
Last Modified: 2013-12-25
Hi!
 I have a program which downloads a file off the internet using an Inet control. The file is on an HTTP server and I'm not sure what to use when I want to get "text.txt" which is located under "www.site.com/text.txt

 Inet1.Execute "http://www.site.com", ??????

How can I make my program proceed AFTER the file has been downloaded? Or how can I find out if the Inet control has finished downloading the file?


Thanks in advance!
0
Comment
Question by:andy_entchev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 11862612
Here is an example of how to download a file using the Inet control.  Code will not continue after the Inet1.OpenURL() call until the file has been completely downloaded.

You just need to change the path and fileName variables to the values you need.

Regards,

Idle_Mind

Private Sub Command1_Click()
    Dim path As String
    Dim fileName As String
    Dim byteData() As Byte
   
    path = "http://www.plgrove.org/america/"
    fileName = "9-11.jpg"

    byteData() = Inet1.OpenURL(path & fileName, icByteArray)
    Open (App.path & "\" & fileName) For Binary Access Write As #1
    Put #1, , byteData()
    Close #1
   
    MsgBox App.path & "\" & fileName, vbInformation, "Download Complete"
End Sub
0
 

Author Comment

by:andy_entchev
ID: 11898863
Thanks alot that worked!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 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