need help in VB code

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
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top