API Overview

API Information for the HTML5 Editor for ActiveX


setLicenceKey(LicenseKey as string)
returns – void
Sets the license key for the control

returns – void
Selects all the content in the WYSIWYG view of the control

returns – void
Copys the current selection to the clipboard

returns – void
Copys the current selection to the clipboard and deletes the selection

returns – void
Pastes the clipboard contents over the current selection (if any)

Align(Element As IHTMLElement, AlignTo As HTMLAlignConstants)
returns – void
Aligns an element or the element’s text content to the value of AlignTo

Public Enum HTMLAlignConstants
    Align_Left = 0
    Align_Center = 1
    Align_Right = 2
    Align_JustifyFull = 3
    Align_Remove = -1
End Enum

ExecWB(cmdID As OLECMDID, cmdexecopt As OLECMDEXECOPT, Optional pvaIn, Optional ByRef pvaOut)
Executes an OLE_CMDID command and returns the status of the command execution in pvaOut


ShowCursorAtElement(element As IHTMLElement, Where As ELEM_ADJ)
returns – void
Moves the edit caret to position specified by ELEM_ADJ in relation to the value of the IHTMLElement “element”

Public Enum ELEM_ADJ
    ELEM_ADJ_BeforeBegin = 0
    ELEM_ADJ_AfterBegin = 1
    ELEM_ADJ_BeforeEnd = 2
    ELEM_ADJ_AfterEnd = 3
End Enum

InsertElementAtCursor(ElementTagName As String, optional className As String) As Object
Returns – IHTMLElement reference to the element being inserted
Inserts a new HTML element specified by ElementTagName with an option CSS class pseudo element ID

InsertAtCursor(HTML As String)
Returns – nothing
Inserts the specified HTML string at the current cursor position. 

TraverseDOMUpwardsForElement(ElementType As String) As Object
Returns – IHTMLElement if the tag specified exists in the DOM branch
Iterates back up through the HTML DOM branch containing the currently selected element and returns the first instance of the element specified by ElementType or returns nothing if the element type does not exist in the DOM branch

IsParentElementType(TagName As String) As Boolean
Returns – Boolean
Iterates back up through the HTML DOM branch containing the currently selected element and returns a Boolean value indicating if the HTML element type exists in the DOM branch

ExecCommand(CommandID As String, Optional ShowUI As Boolean = False, Optional newvalue As Variant = Nothing) As Boolean
Returns – Boolean
Executes the command specified by commandID and returns a Boolean value indicating the success of the command’s execution.


DocumentHTML() As String
The current value of the edited HTML

CSSText() As String
A valid CSS string that controls the layout properties of the elements in the HTML being edited

BaseHREF() As String
The href value of the Base URL for the HTML being edited

FontList() As String
A semi-colon separated list of font names that are available for the user to select from in the control. If this property is blank all the system fonts will be available

EditorEnabled() As Boolean
Enables and disables the WYSIWYG editing of HTML markup in the control. It also hides and unhides the Main toolbar and DOM toolbar controls.

EnableBrowseButtonOnLinkDialog() as Boolean
Shows or hides a browse button on the hyperlink dialog enabling the user to browse for a URL. This may be overridden in the UIRequestsURL event allowing the developer to instigate a custom method.

EnableCodeEditing() As Boolean
Enables and disables the direct editing of HTML source markup in the control.

InCodeView() As Boolean
Sets and returns the current editing mode of the control

UseRelativeURLs() As Boolean
Combined with BaseHREF this forces a link and image elements that are relative to the base url to be referenced as relative URLs in the HTML source.

DefaultTableWidth() As String
The default table width of tables being inserted into the control using the table grid selector menu item. Widths may be defined as any valid HTML numeric value. For example 100%, 100px, 10em, 100pt etc

isDirty() As Boolean
returns a value indicating whether the control has had it contents modified since DocumentHTML was last set

MainToolbar() As Object
Return the upper toolbar object of the control (MSComctlLib toolbar). This can be used to add new buttons to the control or manage other aspects of the main toolbar
Please note that there are many other unused icons to the imagelist control associated with the toolbar starting at index 27 and upwards.

CurrentElement() As IHTMLElement
The currently selected HTML element in the control.


Event ToolBarClick(ButtonName As String, ByRef Cancel As Boolean, ButtonType As String)
Raised when a toolbar button is clicked. Set cancel = true to handle the click externally or cancel the default behaviour of the button click

Event ClipboardCopyCompleted(Clip_Format As br_Format)
Raised when the HTML clipboard data has been copied to the clipboard

Event ClipboardCopyBeforeBegin()
Raised before the clipboard copy process begins

Event ClipboardPasteBeforeBegin()
Raised before paste operation begins. Use this to interrogate and modify the clipboard data before it’s pasted in the control

Event ClipboardPasteCompleted()
Raised when the clipboard data has been pasted to the control

Event OperationError(errNo As Long, errDesc As String)
Raised when internal errors are trapped in the editor.

Event CustomToolBarButtonClick(ButtonKey As String)
Raised when a custom button has been clicked in the control. Use this to handle your own button clicks

Event BeforeInsertImage(ByRef ImageURL As String, ImageElementAlreadyExists As Boolean)
Raised before an image is inserted into the control, and after the image dialog box has closed. Use this to manage image storage and change the URL of the image being inserted. If the image dialog has been shown with an image that already exists in the edited HTML ImageElementAlreadyExists will be true

Event BeforeGetDocumentHTML(ByRef AlterDocumentHTML)
Raised before the value of DocumentHTML is passed back to the calling application. Use this to interrogate and modify the value of DocumentHTML before it is passed back to your code. 

Event BeforeChangeViews(ByRef Cancel As Boolean)
Raised before changing from CodeView to WYSIWYG editing view and vice-versa. Set cancel to true to prevent the change.

Event UIRequestsURL(RequestedBy As URLRequestSources, ByRef CancelDefault As Boolean, ByRef URL As String)
Raised before the user clicks the browse button in the Image, Hyperlink, and Style dialogs allowing the developer to override the default windows open dialog (by setting CancelDefault=true) and setting the string value, URL to the value to be passed back to the control containing the url to be referenced in the HTML.

Public Enum URLRequestSources
    StyleDialog = 0
    ImageDialog = 1
    HyperlinkDialog = 2
End Enum