Click here to Skip to main content
15,897,187 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Closing a modal dialog box in another Windows app... Pin
Waushaka10-Feb-07 15:49
Waushaka10-Feb-07 15:49 
GeneralRe: Closing a modal dialog box in another Windows app... Pin
Christian Graus10-Feb-07 21:18
protectorChristian Graus10-Feb-07 21:18 
QuestionVB.Net 2005 form reset??? Pin
harveyhanson10-Feb-07 14:03
harveyhanson10-Feb-07 14:03 
AnswerRe: VB.Net 2005 form reset??? Pin
Christian Graus10-Feb-07 14:08
protectorChristian Graus10-Feb-07 14:08 
GeneralRe: VB.Net 2005 form reset??? Pin
harveyhanson10-Feb-07 14:10
harveyhanson10-Feb-07 14:10 
GeneralRe: VB.Net 2005 form reset??? Pin
Christian Graus10-Feb-07 14:28
protectorChristian Graus10-Feb-07 14:28 
QuestionVBA Excel Macros Question - Saving Pictures From the Web Pin
ghettoneck10-Feb-07 12:00
ghettoneck10-Feb-07 12:00 
AnswerRe: VBA Excel Macros Question - Saving Pictures From the Web Pin
Dave Kreskowiak10-Feb-07 13:04
mveDave Kreskowiak10-Feb-07 13:04 
I adapted the code here[^] to do something very similar in VBScript. I was downloading an .EXE file, but the concept applies to what you're doing. Let's see, where did I put that script...
GetBinaryFile "http://sourceURL", "destinationFilePath"
 
Private Function NavigateToPage(objIE, url)
	attempts = 0
	timeout = 5000
	i = 0
 
	While attempts < 5
		objIE.Navigate2 url
		While (objIE.ReadyState < READYSTATE_COMPLETE) And (i < timeout)
			WScript.Echo "Waiting... " & i
			WScript.Sleep 100
			i = i + 100
		Wend
		If i >= timeout Then
			WScript.Echo "Retrying..."
			attempts = attempts + 1
			i = 0
		Else
			' Domain should not be blank if the page worked!
			If objIE.Document.Domain <> "" Then
				NavigateToPage = True
				Exit Function
			Else
				NavigateToPage = False
				Exit Function
			End If
		End If
	Wend
	NavigateToPage = False
End Function
 
Private Sub GetBinaryFile(uri, filepath)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Const adSaveCreateNotExist = 1 
 
	Set xml = CreateObject("Microsoft.XMLHTTP")
	xml.Open "GET", uri, False
	WScript.Echo "Downloading " & uri & "..."
	xml.Send
 
	Set oStream = CreateObject("Adodb.Stream")
 
	oStream.Type = adTypeBinary
	oStream.Open
	oStream.Write xml.responseBody
 	
	WScript.Echo "Saving to file " & filepath & "..."
	oStream.SaveToFile filepath, adSaveCreateOverWrite
 
	oStream.Close
	set oStream = Nothing
	Set xml = Nothing
End Sub



Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: VBA Excel Macros Question - Saving Pictures From the Web Pin
ghettoneck10-Feb-07 13:33
ghettoneck10-Feb-07 13:33 
GeneralRe: VBA Excel Macros Question - Saving Pictures From the Web Pin
ghettoneck10-Feb-07 13:42
ghettoneck10-Feb-07 13:42 
QuestionUnpacking in VB.Net Pin
al96810-Feb-07 9:48
al96810-Feb-07 9:48 
Questionform/databse/if statement question. Pin
jady8410-Feb-07 7:17
jady8410-Feb-07 7:17 
AnswerRe: form/databse/if statement question. Pin
Dave Kreskowiak10-Feb-07 8:17
mveDave Kreskowiak10-Feb-07 8:17 
GeneralRe: form/databse/if statement question. Pin
jady8410-Feb-07 11:24
jady8410-Feb-07 11:24 
GeneralRe: form/databse/if statement question. Pin
Christian Graus10-Feb-07 11:37
protectorChristian Graus10-Feb-07 11:37 
AnswerRe: form/databse/if statement question. Pin
Guffa10-Feb-07 11:38
Guffa10-Feb-07 11:38 
GeneralRe: form/databse/if statement question. Pin
jady8410-Feb-07 13:15
jady8410-Feb-07 13:15 
GeneralRe: form/databse/if statement question. Pin
Christian Graus10-Feb-07 14:43
protectorChristian Graus10-Feb-07 14:43 
GeneralRe: form/databse/if statement question. Pin
jady8411-Feb-07 4:22
jady8411-Feb-07 4:22 
GeneralRe: form/databse/if statement question. Pin
Christian Graus11-Feb-07 10:00
protectorChristian Graus11-Feb-07 10:00 
QuestionQuestion - Its urgent Pin
eichmann00910-Feb-07 5:27
eichmann00910-Feb-07 5:27 
AnswerRe: Question - Its urgent Pin
Colin Angus Mackay10-Feb-07 6:01
Colin Angus Mackay10-Feb-07 6:01 
Questionmultyplayers games using a server client communication Pin
yuvalda110-Feb-07 0:18
yuvalda110-Feb-07 0:18 
AnswerRe: multyplayers games using a server client communication Pin
Guffa10-Feb-07 4:17
Guffa10-Feb-07 4:17 
Questionhow could an image be captured from an avi file in vb.net? Pin
Hossein Narimani Rad9-Feb-07 23:36
Hossein Narimani Rad9-Feb-07 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.