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.

Note

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).

ConstantValueDescription
LV2_DATA_FILE_SYSTEMS1File systems
LV2_DATA_INDEXED_DB2IndexedDB
LV2_DATA_LOCAL_STORAGE4Local storage
LV2_DATA_WEB_SQL8Web SQL
LV2_DATA_CACHE_STORAGE16Cache storage
LV2_DATA_DOM_STORAGE32DOM storage
LV2_DATA_COOKIES64Cookies
LV2_DATA_ALL_SITE128All site data
LV2_DATA_DISK_CACHE256Disk cache
LV2_DATA_DOWNLOAD_HISTORY512Download history
LV2_DATA_GENERAL_AUTOFILL1024Autofill data
LV2_DATA_PASSWORD_AUTOSAVE2048Saved passwords
LV2_DATA_BROWSING_HISTORY4096Browsing history
LV2_DATA_SETTINGS8192Settings
LV2_DATA_ALL_PROFILE16384All profile data
' Clear cookies and cache
m_lv.ClearBrowsingData LV2_DATA_COOKIES Or LV2_DATA_CACHE_STORAGE

LiteView2ResourceContext

Resource types for AddWebResourceRequestedFilter.

ConstantValueDescription
LV2_RESOURCE_ALL0All resources
LV2_RESOURCE_DOCUMENT1HTML documents
LV2_RESOURCE_STYLESHEET2CSS
LV2_RESOURCE_IMAGE3Images
LV2_RESOURCE_MEDIA4Audio/Video
LV2_RESOURCE_FONT5Web fonts
LV2_RESOURCE_SCRIPT6JavaScript
LV2_RESOURCE_XHR7XMLHttpRequest
LV2_RESOURCE_FETCH8Fetch API
LV2_RESOURCE_TEXTTRACK9WebVTT
LV2_RESOURCE_EVENTSOURCE10Server-sent events
LV2_RESOURCE_WEBSOCKET11WebSocket
LV2_RESOURCE_MANIFEST12Web App manifests
LV2_RESOURCE_OTHER13Other

LV2_FOCUS_REASON

Specifies the reason for a focus change.

ConstantValueDescription
LV2_FOCUS_TABFORWARD0Tab forward
LV2_FOCUS_TABBACKWARD1Tab backward
LV2_FOCUS_PROGRAMMATIC2Programmatic focus

LV2_POPUP_MODE

Controls how popup windows are handled.

ConstantValueDescription
LV2_POPUP_ALLOW0Allow popups
LV2_POPUP_BLOCK1Block popups
LV2_POPUP_SAME_WINDOW2Open in same window

LV2_LICENSE_STATE

Indicates the current license status.

ConstantValueDescription
LV2_LICENSE_VALID0License valid
LV2_LICENSE_TRIAL1Trial mode
LV2_LICENSE_EXPIRED2License expired
LV2_LICENSE_INVALID3Invalid license

LV2_COLOR_SCHEME

Sets the preferred color scheme for web content.

ConstantValueDescription
LV2_COLOR_AUTO0Follow system
LV2_COLOR_LIGHT1Force light
LV2_COLOR_DARK2Force dark

LV2_PRINT_ORIENTATION

Page orientation for printing and PDF export.

ConstantValueDescription
LV2_PRINT_PORTRAIT0Portrait
LV2_PRINT_LANDSCAPE1Landscape

LV2_TRACKING_PREVENTION

Tracking prevention level for the browser profile.

ConstantValueDescription
LV2_TRACKING_NONE0No prevention
LV2_TRACKING_BASIC1Basic
LV2_TRACKING_BALANCED2Balanced
LV2_TRACKING_STRICT3Strict

LV2_MEMORY_USAGE

Memory usage target level.

ConstantValueDescription
LV2_MEMORY_NORMAL0Normal
LV2_MEMORY_LOW1Low memory target

LV2_SCROLLBAR_STYLE

Scrollbar rendering style.

ConstantValueDescription
LV2_SCROLLBAR_DEFAULT0Default scrollbar
LV2_SCROLLBAR_FLUENT_OVERLAY1Fluent overlay

LV2_DOWNLOAD_DIALOG_CORNER_ALIGNMENT

Corner alignment for the download dialog.

ConstantValueDescription
LV2_DOWNLOAD_CORNER_TOP_LEFT0Top left
LV2_DOWNLOAD_CORNER_TOP_RIGHT1Top right
LV2_DOWNLOAD_CORNER_BOTTOM_LEFT2Bottom left
LV2_DOWNLOAD_CORNER_BOTTOM_RIGHT3Bottom right

LV2_PDF_TOOLBAR_ITEMS Flags

Bitfield flags for controlling PDF viewer toolbar visibility.

ConstantValueDescription
LV2_PDF_NONE0No items
LV2_PDF_SAVE1Save button
LV2_PDF_PRINT2Print button
LV2_PDF_SAVE_AS4Save As button
LV2_PDF_ZOOM_IN8Zoom In button
LV2_PDF_ZOOM_OUT16Zoom 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_PIXELS0Bounds are specified in raw pixels (default). The WebView2 control is positioned using raw pixel coordinates regardless of DPI scaling.
LV2_BOUNDS_RASTERIZATION_SCALE1Bounds 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.

ConstantValueDescription
LV2_BIND_NONE0Default. Resolve lazily; the first call surfaces any resolution error.
LV2_BIND_VALIDATE1Resolve the object at bind time; return an error immediately if it is missing.
LV2_BIND_TRANSIENT2Drop the binding on the next navigation instead of re-resolving it.
LV2_BIND_RAW_EXPRESSION4Accept an arbitrary JavaScript expression instead of a simple object path. The caller accepts the injection risk — use only with trusted strings.
LV2_BIND_ASYNC8Reserved — accepted but has no effect in this release.
LV2_BIND_FAIL_IF_BOUND16Return an error instead of silently replacing an existing binding.
LV2_BIND_FOLLOW_RESOLUTION32Re-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.

ConstantValueWhen
LV2_BRIDGE_ALIAS_NOT_FOUND&H80040501Call on an alias that was never bound.
LV2_BRIDGE_OBJECT_NOT_RESOLVED&H80040502The bound expression evaluates to nothing on the page.
LV2_BRIDGE_METHOD_NOT_FOUND&H80040503No method of that name on the object.
LV2_BRIDGE_PROPERTY_NOT_FOUND&H80040504No property of that name on the object.
LV2_BRIDGE_JS_EXCEPTION&H80040505The JavaScript threw — see the message.
LV2_BRIDGE_PROMISE_RETURNED&H80040506A synchronous call received a Promise; use a synchronous method.
LV2_BRIDGE_TIMEOUT&H80040507The call did not complete within 30 seconds.
LV2_BRIDGE_NOT_READY&H80040508The browser is not ready yet.
LV2_BRIDGE_INVALID_ARG&H80040509Bad alias/member name, or a value that cannot be passed.
LV2_BRIDGE_INVALID_EXPRESSION&H8004050AThe bind expression is not a safe object path (use LV2_BIND_RAW_EXPRESSION to override).
LV2_BRIDGE_REENTRY_BLOCKED&H8004050BToo many nested synchronous calls.
LV2_BRIDGE_ALIAS_ALREADY_BOUND&H8004050CRebind blocked because LV2_BIND_FAIL_IF_BOUND was set.
LV2_BRIDGE_PROPERTY_IS_FUNCTION&H8004050DGetScriptProperty target is a function (usable as a method-exists probe).
Explore More:
Core API | Events | JSON | Browser Pool | Enumerations