Guide to Switching Between VB Macro/JS Macro Environments in WPS Docs

Feature Summary

WPS Docs supports two macro development environments: VBA (VB Macro) and JS (JavaScript Macro). Users can switch the default macro environment as needed, flexibly choosing the appropriate programming language to automate document processing.

Feature Description

Feature Dimension Description
Version Restriction - VBA Macro Windows systems require the VBA plugin to be installed. MAC systems, Linux systems, and mobile versions are not supported.

Operation Steps

Setting the Default JS Development Environment

Feature Entry
"File" Menu → "Options" → "View" Tab → "Default JS Development Environment" Checkbox

  1. Click the File menu in the upper left corner
  2. Select Options to open the Options dialog box
  3. In the left navigation bar, select the View tab
  4. On the right side, find the "Default JS Development Environment" checkbox
  5. Check this option and click OK to save the settings
  6. The change takes effect after restarting WPS, and the WPS Macro Editor (JS environment) will open by default

截图

Switching Back to the VB Environment

Feature Entry
"Tools" Tab → "Developer Tools" Tab → "Switch to VB Environment"

  1. Click the Tools tab in the upper left corner
  2. Select the Developer Tools option to open the Developer Tools tab
  3. In the Developer Tools tab, click the "Switch to VB Environment" button

截图
截图

FAQ

Q1: I set the default JS environment, but the VB editor still opens

  • Solution: You need to restart WPS for the setting to take effect. If it still does not work after restarting, check whether the "Default JS Development Environment" option under "File" → "Options" → "View" is correctly checked.

Q2: Can the original macro code still run after switching environments?

  • Solution: Switching the macro environment does not affect saved macro code. Switching back to the original macro code environment will allow it to run normally.

Notes

  1. Environment Independence: VBA and JS are two independent macro environments with different code syntax and operating mechanisms, and they are not compatible with each other.
  2. Cross-Platform Limitations: VBA macros are only supported on Windows systems, while JS macros support all platforms (Windows/MAC/Linux).
  3. File Format: Documents containing macros must be saved in the macro-enabled .docm format.
  4. Security Advice: Before running macros, ensure the security of the macro file and do not run macro files from unknown sources.