LiteView2 WebView2 VBA Enumerations — 13 Enums and All Constants
13 enums defining constants used across the LiteView2 API
Works in VBA (Excel, Access, Word, Outlook, PowerPoint, Visio, Project), VB6, VB.NET, C#, C++, Delphi, Python, PowerShell, AutoIt — and any COM host.
Flag enums (marked with Flags) can be combined using bitwise OR.
LiteView2BrowsingDataKinds Flags
Bitfield flags for ClearBrowsingData. Combine with OR (e.g., LV2_DATA_COOKIES Or LV2_DATA_CACHE_STORAGE).
| Constant | Value | Description |
|---|---|---|
| LV2_DATA_FILE_SYSTEMS | 1 | File systems |
| LV2_DATA_INDEXED_DB | 2 | IndexedDB |
| LV2_DATA_LOCAL_STORAGE | 4 | Local storage |
| LV2_DATA_WEB_SQL | 8 | Web SQL |
| LV2_DATA_CACHE_STORAGE | 16 | Cache storage |
| LV2_DATA_DOM_STORAGE | 32 | DOM storage |
| LV2_DATA_COOKIES | 64 | Cookies |
| LV2_DATA_ALL_SITE | 128 | All site data |
| LV2_DATA_DISK_CACHE | 256 | Disk cache |
| LV2_DATA_DOWNLOAD_HISTORY | 512 | Download history |
| LV2_DATA_GENERAL_AUTOFILL | 1024 | Autofill data |
| LV2_DATA_PASSWORD_AUTOSAVE | 2048 | Saved passwords |
| LV2_DATA_BROWSING_HISTORY | 4096 | Browsing history |
| LV2_DATA_SETTINGS | 8192 | Settings |
| LV2_DATA_ALL_PROFILE | 16384 | All profile data |
' Clear cookies and cache
m_lv.ClearBrowsingData LV2_DATA_COOKIES Or LV2_DATA_CACHE_STORAGE
LiteView2ResourceContext
Resource types for AddWebResourceRequestedFilter.
| Constant | Value | Description |
|---|---|---|
| LV2_RESOURCE_ALL | 0 | All resources |
| LV2_RESOURCE_DOCUMENT | 1 | HTML documents |
| LV2_RESOURCE_STYLESHEET | 2 | CSS |
| LV2_RESOURCE_IMAGE | 3 | Images |
| LV2_RESOURCE_MEDIA | 4 | Audio/Video |
| LV2_RESOURCE_FONT | 5 | Web fonts |
| LV2_RESOURCE_SCRIPT | 6 | JavaScript |
| LV2_RESOURCE_XHR | 7 | XMLHttpRequest |
| LV2_RESOURCE_FETCH | 8 | Fetch API |
| LV2_RESOURCE_TEXTTRACK | 9 | WebVTT |
| LV2_RESOURCE_EVENTSOURCE | 10 | Server-sent events |
| LV2_RESOURCE_WEBSOCKET | 11 | WebSocket |
| LV2_RESOURCE_MANIFEST | 12 | Web App manifests |
| LV2_RESOURCE_OTHER | 13 | Other |
LV2_FOCUS_REASON
Specifies the reason for a focus change.
| Constant | Value | Description |
|---|---|---|
| LV2_FOCUS_TABFORWARD | 0 | Tab forward |
| LV2_FOCUS_TABBACKWARD | 1 | Tab backward |
| LV2_FOCUS_PROGRAMMATIC | 2 | Programmatic focus |
LV2_POPUP_MODE
Controls how popup windows are handled.
| Constant | Value | Description |
|---|---|---|
| LV2_POPUP_ALLOW | 0 | Allow popups |
| LV2_POPUP_BLOCK | 1 | Block popups |
| LV2_POPUP_SAME_WINDOW | 2 | Open in same window |
LV2_LICENSE_STATE
Indicates the current license status.
| Constant | Value | Description |
|---|---|---|
| LV2_LICENSE_VALID | 0 | License valid |
| LV2_LICENSE_TRIAL | 1 | Trial mode |
| LV2_LICENSE_EXPIRED | 2 | License expired |
| LV2_LICENSE_INVALID | 3 | Invalid license |
LV2_COLOR_SCHEME
Sets the preferred color scheme for web content.
| Constant | Value | Description |
|---|---|---|
| LV2_COLOR_AUTO | 0 | Follow system |
| LV2_COLOR_LIGHT | 1 | Force light |
| LV2_COLOR_DARK | 2 | Force dark |
LV2_PRINT_ORIENTATION
Page orientation for printing and PDF export.
| Constant | Value | Description |
|---|---|---|
| LV2_PRINT_PORTRAIT | 0 | Portrait |
| LV2_PRINT_LANDSCAPE | 1 | Landscape |
LV2_TRACKING_PREVENTION
Tracking prevention level for the browser profile.
| Constant | Value | Description |
|---|---|---|
| LV2_TRACKING_NONE | 0 | No prevention |
| LV2_TRACKING_BASIC | 1 | Basic |
| LV2_TRACKING_BALANCED | 2 | Balanced |
| LV2_TRACKING_STRICT | 3 | Strict |
LV2_MEMORY_USAGE
Memory usage target level.
| Constant | Value | Description |
|---|---|---|
| LV2_MEMORY_NORMAL | 0 | Normal |
| LV2_MEMORY_LOW | 1 | Low memory target |
LV2_SCROLLBAR_STYLE
Scrollbar rendering style.
| Constant | Value | Description |
|---|---|---|
| LV2_SCROLLBAR_DEFAULT | 0 | Default scrollbar |
| LV2_SCROLLBAR_FLUENT_OVERLAY | 1 | Fluent overlay |
LV2_DOWNLOAD_DIALOG_CORNER_ALIGNMENT
Corner alignment for the download dialog.
| Constant | Value | Description |
|---|---|---|
| LV2_DOWNLOAD_CORNER_TOP_LEFT | 0 | Top left |
| LV2_DOWNLOAD_CORNER_TOP_RIGHT | 1 | Top right |
| LV2_DOWNLOAD_CORNER_BOTTOM_LEFT | 2 | Bottom left |
| LV2_DOWNLOAD_CORNER_BOTTOM_RIGHT | 3 | Bottom right |
LV2_PDF_TOOLBAR_ITEMS Flags
Bitfield flags for controlling PDF viewer toolbar visibility.
| Constant | Value | Description |
|---|---|---|
| LV2_PDF_NONE | 0 | No items |
| LV2_PDF_SAVE | 1 | Save button |
| LV2_PDF_PRINT | 2 | Print button |
| LV2_PDF_SAVE_AS | 4 | Save As button |
| LV2_PDF_ZOOM_IN | 8 | Zoom In button |
| LV2_PDF_ZOOM_OUT | 16 | Zoom Out button |
' Hide Save and Print buttons from PDF toolbar
m_lv.HiddenPdfToolbarItems = LV2_PDF_SAVE Or LV2_PDF_PRINT
LV2_BOUNDS_MODE
Controls how bounds coordinates are interpreted when embedding the browser.
| Constant | Value | Description |
|---|---|---|
| LV2_BOUNDS_RAW_PIXELS | 0 | Bounds are specified in raw pixels (default). The WebView2 control is positioned using raw pixel coordinates regardless of DPI scaling. |
| LV2_BOUNDS_RASTERIZATION_SCALE | 1 | Bounds use the rasterization scale. Coordinates are automatically adjusted for the current DPI/scaling factor of the display. |
' Use DPI-aware bounds
pool.SetBoundsMode browserIndex, LV2_BOUNDS_RASTERIZATION_SCALE
LV2_BIND_FLAGS Flags
Optional flags for BindScriptObject in the Two-Way Script Bridge. Combine with Or.
| Constant | Value | Description |
|---|---|---|
| LV2_BIND_NONE | 0 | Default. Resolve lazily; the first call surfaces any resolution error. |
| LV2_BIND_VALIDATE | 1 | Resolve the object at bind time; return an error immediately if it is missing. |
| LV2_BIND_TRANSIENT | 2 | Drop the binding on the next navigation instead of re-resolving it. |
| LV2_BIND_RAW_EXPRESSION | 4 | Accept an arbitrary JavaScript expression instead of a simple object path. The caller accepts the injection risk — use only with trusted strings. |
| LV2_BIND_ASYNC | 8 | Reserved — accepted but has no effect in this release. |
| LV2_BIND_FAIL_IF_BOUND | 16 | Return an error instead of silently replacing an existing binding. |
| LV2_BIND_FOLLOW_RESOLUTION | 32 | Re-evaluate the expression on every call (tracks reassignment) instead of capturing the object once at bind time. |
' Validate at bind time
m_lv.BindScriptObject "page", "window.PageController", LV2_BIND_VALIDATE
LV2_BRIDGE_ERR
Error codes returned by the Two-Way Script Bridge — surfaced as Err.Number and via GetLastBridgeError.
| Constant | Value | When |
|---|---|---|
| LV2_BRIDGE_ALIAS_NOT_FOUND | &H80040501 | Call on an alias that was never bound. |
| LV2_BRIDGE_OBJECT_NOT_RESOLVED | &H80040502 | The bound expression evaluates to nothing on the page. |
| LV2_BRIDGE_METHOD_NOT_FOUND | &H80040503 | No method of that name on the object. |
| LV2_BRIDGE_PROPERTY_NOT_FOUND | &H80040504 | No property of that name on the object. |
| LV2_BRIDGE_JS_EXCEPTION | &H80040505 | The JavaScript threw — see the message. |
| LV2_BRIDGE_PROMISE_RETURNED | &H80040506 | A synchronous call received a Promise; use a synchronous method. |
| LV2_BRIDGE_TIMEOUT | &H80040507 | The call did not complete within 30 seconds. |
| LV2_BRIDGE_NOT_READY | &H80040508 | The browser is not ready yet. |
| LV2_BRIDGE_INVALID_ARG | &H80040509 | Bad alias/member name, or a value that cannot be passed. |
| LV2_BRIDGE_INVALID_EXPRESSION | &H8004050A | The bind expression is not a safe object path (use LV2_BIND_RAW_EXPRESSION to override). |
| LV2_BRIDGE_REENTRY_BLOCKED | &H8004050B | Too many nested synchronous calls. |
| LV2_BRIDGE_ALIAS_ALREADY_BOUND | &H8004050C | Rebind blocked because LV2_BIND_FAIL_IF_BOUND was set. |
| LV2_BRIDGE_PROPERTY_IS_FUNCTION | &H8004050D | GetScriptProperty target is a function (usable as a method-exists probe). |