Platforms to show: All Mac Windows Linux Cross-Platform

IEDocumentMBS.CallFunction(FunctionName as string, paramArray params as variant) as variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Calls a JavaScript function.
Example:
dim doc as IEDocumentMBS = htmlviewer1.IEDocumentMBS

dim v as variant = doc.CallFunctiom("test", 2, 3)
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.

See also:

Feedback, Comments & Corrections

IEDocumentMBS.CallFunction(FunctionName as string, params() as variant) as variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Calls a JavaScript function.
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)
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.

See also:

Feedback, Comments & Corrections

IEDocumentMBS.Constructor(HTMLViewer as HTMLViewer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Creates new web document object for this HTMLViewer.
Notes:
For browser based on Internet Explorer on Windows.
Raises exception on failure.

Feedback, Comments & Corrections

IEDocumentMBS.ContinueFindText(text as string, count as integer, flags as integer, selectText as boolean) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Continues a search started with IEFindTextMBS.
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
Notes: Parameters are the same as for IEFindTextMBS.

Feedback, Comments & Corrections

IEDocumentMBS.DrawToHDC(HDC as Ptr, PrinterName as string = "")
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
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.

Feedback, Comments & Corrections

IEDocumentMBS.Evaluate(expression as string) as variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Evaluates a JavaScript expression.
Example:
dim doc as IEDocumentMBS = htmlviewer1.IEDocumentMBS

dim v as variant = doc.Evaluate("1+2")
Msgbox v
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.

Feedback, Comments & Corrections

IEDocumentMBS.FindText(text as string, count as integer, flags as integer, selectText as boolean) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Finds text on the current website.
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
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:

0Default. Match partial words.
1Match backwards.
2Match whole words only.
4Match case.
131072Match bytes.
536870912Match diacritical marks.
1073741824Match Kashida character.
2147483648Match AlefHamza character.

Returns true: The search text was found.
Returns false: The search text was not found.

Feedback, Comments & Corrections

IEDocumentMBS.GetTextArea(FormName as String, FieldName as String) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
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.

Feedback, Comments & Corrections

IEDocumentMBS.HTMLText as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Returns a copy of the html source code of the current webpage.
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
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.

On Mac OS X, you can use HTMLViewer1.mainFrameMBS.dataSource.data to get the document html text.

Feedback, Comments & Corrections

IEDocumentMBS.Image as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Copies the picture from the document.
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
dim p as Picture = d.Image
canvas1.Backdrop = p
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.

Feedback, Comments & Corrections

IEDocumentMBS.LoadHTML(HTMLText as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Loads the HTML text into the htmlviewer.
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS

d.LoadHTML "<p>Hello World</p>"
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).

Feedback, Comments & Corrections

IEDocumentMBS.PrintPreview as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
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.

Feedback, Comments & Corrections

IEDocumentMBS.Reload(Force as boolean = false)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Reloads the current page.
Example:
dim d as IEDocumentMBS = HTMLViewer1.IEDocumentMBS
d.Reload
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.

Feedback, Comments & Corrections

IEDocumentMBS.SetTextArea(FormName as String, FieldName as String, Value as String) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
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.

Feedback, Comments & Corrections

IEDocumentMBS.Text as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Win MBS Win Plugin 20.0 No Yes No No No
Function: Returns a copy of the text of the current webpage.
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
Notes:
Asks Internet Explorer for a selection of the whole document and asks selection about the text content.
Returns "" on any error.

On Mac OS X, you can use HTMLViewer1.mainFrameMBS.dataSource.data to get the document html text.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.

The biggest plugin in space...




Links
MBS Xojo Plugins