View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gregg Roberts Gregg Roberts is offline
external usenet poster
 
Posts: 25
Default HTML Document.Links Issues

Tim,

This is awesome! Thank you so much.

Since you've been so helpful, I'm going to ask you a few more questions.
Obviously you're free to say "enough" at any point. I think these additional
questions still fit my subject line...

1. Are there other ReadyStates that I should handle besides
READYSTATE_COMPLETE? What if an OK/Cancel prompt appears upon navigation,
such as "You are about to visit a page that has unsecure items..." Will that
give ReadyState = READYSTATE_INTERACTIVE? What about a 404 error -- will that
still give READYSTATE_COMPLETE?

2. What if a link href is to a non-HTML file such as a .WMV, .DOC, or .PDF?
I don't want the macro to try to visit such links, even though it should not
cause an error on my machine. Short of building and maintaining a list of
what file types to visit or not, how do I determine whether to navigate to
the URL? Parsing the file extension is not straightforward because of active
pages, which can contain spurious "file extension" matches.

I really want this code to be robust and there's a lot to think about.

Gregg Roberts

P.S. I was already saving the links collection to a variable, LinkTags1 --
not just accessing it via IEDoc.Links. However, if I navigate to a new page
without setting IEDoc = IEApp.Document, why would IEDoc.Links be affected at
all -- much less be made *inaccessible*? Remember, the error message was
Permission Denied, not Object Required, Object Does Not Exist, or some more
generic error.

P.P.S. Where can I read more about how all this works? The MSDN site seems
to refer to a lot of environments I am not using, hence the examples don't
work.