Platforms to show: All Mac Windows Linux Cross-Platform
Back to IEDocumentMBS class.
IEDocumentMBS.CallFunction(FunctionName as string, paramArray params as variant) as variant
Function:
Calls a JavaScript function.
Example:
Notes:
Returns result as variant.
You can pass as many parameters as needed.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
FunctionName should be the name of a global function defined in JavaScript.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim doc as IEDocumentMBS = htmlviewer1.IEDocumentMBS
dim v as variant = doc.CallFunctiom("test", 2, 3)
Returns result as variant.
You can pass as many parameters as needed.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
FunctionName should be the name of a global function defined in JavaScript.
See also:
IEDocumentMBS.CallFunction(FunctionName as string, params() as variant) as variant
Function:
Calls a JavaScript function.
Example:
Notes:
Returns result as variant.
You can pass parameters for the function as array.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
FunctionName should be the name of a global function defined in JavaScript.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim doc as IEDocumentMBS = htmlviewer1.IEDocumentMBS
dim Params() as Variant
Params.append 2
Params.append 3
dim v as variant = doc.CallFunctiom("test", Params)
Returns result as variant.
You can pass parameters for the function as array.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
FunctionName should be the name of a global function defined in JavaScript.
See also:
IEDocumentMBS.Constructor(DesktopHTMLViewer as DesktopHTMLViewer)
Function:
Creates new web document object for this HTMLViewer.
Notes:
For browser based on Internet Explorer on Windows.
Raises exception on failure.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
For browser based on Internet Explorer on Windows.
Raises exception on failure.
See also:
IEDocumentMBS.Constructor(HTMLViewer as HTMLViewer)
Function:
Creates new web document object for this HTMLViewer.
Notes:
For browser based on Internet Explorer on Windows.
Raises exception on failure.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
For browser based on Internet Explorer on Windows.
Raises exception on failure.
See also:
IEDocumentMBS.ContinueFindText(text as string, count as integer, flags as integer, selectText as boolean) as boolean
Function:
Continues a search started with IEFindTextMBS.
Example:
Notes:
Parameters are the same as for IEFindTextMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
// find first
dim found as boolean = d.FindText("Xojo", 0, 0, true)
msgbox "Found Xojo: "+str(found)
if found then
// find next
found = d.ContinueFindText("Xojo", 0, 0, true)
end if
IEDocumentMBS.DrawToHDC(HDC as Ptr, PrinterName as string = "")
Function:
Draws the content of the html document into the graphics context.
Notes:
As of Windows Internet Explorer 9, this method is deprecated and should not be used.
Returns true on success and false on failure.
With some printers, running DrawToDC may cause problems. You can ensure that DrawToDC works properly on all printers by running SetDocumentPrinter method first, and then passing the modified device context to DrawToDC. The plugin calls SetDocumentPrinter for you when you provide a printer name.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
As of Windows Internet Explorer 9, this method is deprecated and should not be used.
Returns true on success and false on failure.
With some printers, running DrawToDC may cause problems. You can ensure that DrawToDC works properly on all printers by running SetDocumentPrinter method first, and then passing the modified device context to DrawToDC. The plugin calls SetDocumentPrinter for you when you provide a printer name.
IEDocumentMBS.Evaluate(expression as string) as variant
Function:
Evaluates a JavaScript expression.
Example:
Notes:
In contrast to IEWindowMBS.RunJavaScript this function returns the result on Windows, but needs IE 9 or newer.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim doc as IEDocumentMBS = htmlviewer1.IEDocumentMBS
dim v as variant = doc.Evaluate("1+2")
Msgbox v
In contrast to IEWindowMBS.RunJavaScript this function returns the result on Windows, but needs IE 9 or newer.
Our plugin converts Xojo data types to JavaScript data types like boolean, number, text or NULL. This could be extended in future to convert arrays, too.
IEDocumentMBS.FindText(text as string, count as integer, flags as integer, selectText as boolean) as boolean
Function:
Finds text on the current website.
Example:
Notes:
text: the string that specifies the text to find.
count: long that specifies the number of characters to search from the starting point of the range. A positive integer indicates a forward search; a negative integer indicates a backward search.
Flags: integer that specifies one or more of the following flags to indicate the type of search:
Returns true: The search text was found.
Returns false: The search text was not found.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
// find first
dim found as boolean = d.FindText("Xojo", 0, 0, true)
msgbox "Found Xojo: "+str(found)
if found then
// find next
found = d.ContinueFindText("Xojo", 0, 0, true)
end if
text: the string that specifies the text to find.
count: long that specifies the number of characters to search from the starting point of the range. A positive integer indicates a forward search; a negative integer indicates a backward search.
Flags: integer that specifies one or more of the following flags to indicate the type of search:
0 | Default. Match partial words. |
1 | Match backwards. |
2 | Match whole words only. |
4 | Match case. |
131072 | Match bytes. |
536870912 | Match diacritical marks. |
1073741824 | Match Kashida character. |
2147483648 | Match AlefHamza character. |
Returns true: The search text was found.
Returns false: The search text was not found.
IEDocumentMBS.Frames as IEWindowMBS()
Function:
Queries the collection of frames.
Example:
Notes:
MBS Plugin will return the window objects for each frame as an array.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 21.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
Dim hdoc As IEDocumentMBS = HTMLViewer1.IEDocumentMBS
Dim frames() As IEWindowMBS = hdoc.Frames
For Each frame As IEWindowMBS In frames
Dim doc As IEDocumentMBS = frame.Document
Dim URL As String = doc.URL
Dim Name As String = doc.NameProp
Dim HTMLText As String = doc.HTMLText
Break // read in debugger
Next
IEDocumentMBS.GetTextArea(FormName as String, FieldName as String) as String
Function:
Queries text for a textarea.
Notes:
FormName can be "" to look for any field with given name.
Raises exception if field is not found.
Returns text from textarea.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
FormName can be "" to look for any field with given name.
Raises exception if field is not found.
Returns text from textarea.
IEDocumentMBS.HTMLText as string
Function:
Returns a copy of the html source code of the current webpage.
Example:
Notes:
Improved in plugin version 12.2 to return better HTML text. This is the html generated from current web content and not the page we originally loaded. So this works with Editable property.
Returns "" on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
dim htmlText as string = d.HTMLText
dim PlainText as string = d.text
dim toString as string = d.ToString
Break // see in debug
Improved in plugin version 12.2 to return better HTML text. This is the html generated from current web content and not the page we originally loaded. So this works with Editable property.
Returns "" on any error.
IEDocumentMBS.Image as picture
Function:
Copies the picture from the document.
Example:
Notes:
You may want to resize the htmlviewer to get a picture without scrollbars. (See example projects)
You may need to call ClearFocus as it seems like if the focus is on the htmlviewer it does not draw itself in our picture.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
dim p as Picture = d.Image
canvas1.Backdrop = p
You may want to resize the htmlviewer to get a picture without scrollbars. (See example projects)
You may need to call ClearFocus as it seems like if the focus is on the htmlviewer it does not draw itself in our picture.
IEDocumentMBS.LoadHTML(HTMLText as string)
Function:
Loads the HTML text into the htmlviewer.
Example:
Notes:
Does not use a temp file like Xojo's built in method.
Returns true on success.
On Windows you may need to reset webviewer before or load "about:blank" to initialize the webviewer by Xojo (or Xojo).
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
d.LoadHTML "<p>Hello World</p>"
Does not use a temp file like Xojo's built in method.
Returns true on success.
On Windows you may need to reset webviewer before or load "about:blank" to initialize the webviewer by Xojo (or Xojo).
IEDocumentMBS.PrintPreview as boolean
Function:
Commands Internet Explorer to show the print preview dialog for this htmlviewer.
Notes:
Returns true on success. Returns false if function is not supported.
The function returns directly while the preview dialog is still running.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Returns true on success. Returns false if function is not supported.
The function returns directly while the preview dialog is still running.
IEDocumentMBS.Reload(Force as boolean = false)
Function:
Reloads the current page.
Example:
Notes:
Boolean that specifies one of the following possible values:
False: Default. Reloads the document from the cache.
True: Reloads the document from the server.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
d.Reload
Boolean that specifies one of the following possible values:
False: Default. Reloads the document from the cache.
True: Reloads the document from the server.
IEDocumentMBS.SetTextArea(FormName as String, FieldName as String, Value as String) as Boolean
Function:
Sets text for a textarea.
Notes:
FormName can be "" to look for any field with given name.
Raises exception if field is not found.
Returns true if text is set or false on failure.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
FormName can be "" to look for any field with given name.
Raises exception if field is not found.
Returns true if text is set or false on failure.
IEDocumentMBS.Text as string
Function:
Returns a copy of the text of the current webpage.
Example:
Notes:
Asks Internet Explorer for a selection of the whole document and asks selection about the text content.
Returns "" on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | HTMLViewer Win | MBS Win Plugin | 20.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
dim htmlText as string = d.HTMLText
dim PlainText as string = d.text
dim toString as string = d.ToString
Break // see in debug
Asks Internet Explorer for a selection of the whole document and asks selection about the text content.
Returns "" on any error.
The items on this page are in the following plugins: MBS Win Plugin.
