Results 1 to 3 of 3

Thread: Early Binding HTML Label Attributes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Location
    San Francisco, CA
    Posts
    331

    Early Binding HTML Label Attributes

    I need some help from somebody who can show me how to early bind an HTML label element's attribute property. My application uses the "Option Strict" compiler directive as True so I have to use early binding instead of late binding. I know how to do this via late binding, but cannot figure out the syntax for early binding.

    Here's my code...

    Code:
    flgFound = False
    For Each objLabel As HTMLLabelElement In objHTMLDoc.getElementsByTagName("Label")
        For i = 0 To CType(objLabel.attributes, HTMLAttributeCollection).length - 1
            If objLabel.attributes(i).name = "for" Then
                flgFound = True
                strQuestion = objLabel.innerText
                Exit For
            End If
        Next i
        If flgFound Then Exit For
    Next objLabel
    I need help to add early binding to this line of my code:
    Code:
    If objLabel.attributes(i).name = "for" Then
    Thanks in advance for any helpful advice.
    Last edited by Mark@SF; Mar 25th, 2015 at 06:04 PM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,399

    Re: Early Binding HTML Label Attributes

    For each objLabel as HTMLLabelElement in objHTMLDoc.getElementsByTagName("Label")
    ...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Location
    San Francisco, CA
    Posts
    331

    Re: Early Binding HTML Label Attributes

    .paul.

    Thanks for the quick reply. I edited the code snippet in my thread with what I have tried so far. I need help with one line of code (as shown in the updated code snippet). Can you take another look at it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width