PDA

View Full Version : [newbie] vba to check hyperlinks



jon80
02-28-2009, 10:57 AM
I would like to go through the urls within a Word 2003 document and check that the URLs are valid (e.g. do not return http error 404, 401...).

Any ideas, pls?

macropod
03-01-2009, 03:41 PM
Hi jon,

Those 40# errors don't necessarily mean the link is invalid - the web site may be down, you may need to supply a password, etc. Also, the absence of such a message doesn't mean the link is valid (for example, try: http://www.vbaexpress.com/forum/forumdisplay.php?f=120)

jon80
03-02-2009, 10:20 AM
Thanks. The link is invalid though.

fumei
03-02-2009, 12:06 PM
Umm, that was the point. The link - the one posted by macropod - is an invalid pointer, but you did NOT get a 404 error. Which is why he stated:

"absence of such a message doesn't mean the link is valid "

In other words:

It could be an invalid link, but NOT get a 40# error.

It could be a valid link, but GET a 404 error (if, say, the web site is down).