Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dhtml editor
#1
i am trying to get the current selection, in the triedit documentation they say:

Code:
Copy      Help
Private Sub GetElementUnderInsertionPoint()
   Dim rg As IHTMLTxtRange
   Dim ctlRg As IHTMLControlRange
   Select Case DHTMLEdit1.DOM.selection.Type
      Case "None", "Text"
         ' This reduces the selection to just the insertion
         ' point. The parentElement method will then return the
         ' element directly under the mouse pointer.
         Set rg = DHTMLEdit1.DOM.selection.createRange
         rg.collapse
         MsgBox rg.parentElement.outerHTML
      Case "Control"
         ' A form or image is selected. The commonParentElement
         ' will return the site selected element.
         Set ctlRg = DHTMLEdit1.DOM.selection.createRange
         MsgBox ctlRg.commonParentElement.outerHTML
   End Select
End Sub

when i control click on dh4.DOM i get
Code:
Copy      Help
IHTMLDocument2  DOM()   .   Property,  read-only
property Document Object Model
.

but where and how do i access DOM.selection ?

thanks
pi


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)