Anchors and frames and mshtml.document

Posted on 2006-05-25
Last Modified: 2012-06-27
Hi people,

well I got a nice mshtml.htmldocument object in my hand, and I want to use the anchors property of the object which is really concise and nice.

when i use an url like, it works fine, I can see all the anchors up to their tiniest details. But when I go to a site like, the anchors property comes empty

I'm guessing that this happens because the page has frames. Do I have to iterate through all the frames in the document ? If so, how ?

PS. TheLearnedOne, I'm not using webbrowser control ;)

Best regards.
Question by:wildcard76
    LVL 96

    Accepted Solution

    If you look at the header of the source document, you will notice that the MSDN site uses XHTML:

    <?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns="" dir="ltr" lang="en-us"><head id="ctl00_Head1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="ms.locale" content="en-us" />

    That is a totally different proposition.

    LVL 3

    Author Comment

    so I gather, frames or not, the anchor property should be givin us all the link elements, and when it comes to xhtml, what should be the correct approach to this one then?

    LVL 96

    Expert Comment

    by:Bob Learned
    I haven't worked with XHTML, so I don't know the best approach here.  I do know enough to know that the structure is distinctly different enough for the code that I showed you not to work.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now