need help in VB code

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

hi,
anyone can help me to fit this code as a macro ?
thanks


Option Explicit

function checkURL(file)
Dim oHTTP, status
set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oHTTP.open "GET", file, False
oHTTP.send
status = oHTTP.Status
if status = 200 then
checkURL = " exists!"
else
checkURL = " does not exists."
end if
set oHTTP = nothing
end function
 
I'm not sure what information you're looking for. You certainly could copy
and paste this code into an Outlook VBA module and it would run. A "macro,"
strictly speaking, is an argumentless subroutine. This would be an example
of a macro that calls your procedure:

Sub CheckURL()
Dim strFile as String
strFile = "http://www.yahoo.com"
MsgBox strFile & checkURL(strFile)
End Sub
 
Back
Top