logo
search
VBA & Macro Problems

How to Show English or Italian Text in a Word Document Using VBA

Natalie TaylorNatalie Taylor Oct 10, 2026 870 views

Question details

The user wants to toggle the visibility of English and Italian text in a multilingual Word document for reading and printing.

How to Show English or Italian Text in a Word Document Using VBA Macros
Product
Word
Device & OS
not provided
Scenario
Managing a bilingual document where only one language (either English or Italian) should be visible and printable at a time.
Observed behavior
Both languages are currently displayed together, requiring an automated method to selectively hide one language and show the other, or to show both.
Before you start

Ensure your document is properly formatted using distinct paragraph styles for each language, and verify that the Developer tab is enabled in your ribbon to access the VBA editor.

Solution 1Recommended

Use a VBA Macro to Toggle Paragraph Styles

Create specific language styles and use a VBA macro to automatically hide or show them based on your current reading or printing needs.

This method relies on Word's ability to hide text based on paragraph styles. By creating matching style levels for English and Italian, a short VBA script can loop through them and toggle their hidden property.

1
Create Language-Specific Styles

Open the Styles pane and create custom paragraph styles named 'Text1English' through 'Text9English' and 'Text1Italian' through 'Text9Italian'. Apply these styles to the respective paragraphs in your document.

2
Open the VBA Editor

Press Alt + F11 to open the Visual Basic for Applications (VBA) editor. Click Insert > Module to create a new blank module.

3
Insert the Toggle Macros

Paste the 'SwitchLanguages' macro code provided in the solution to toggle the hidden font status. Also, paste the 'ShowBoth' macro to unhide all styles when you want to view the original bilingual document.

4
Run the Macro

Close the VBA editor. Go to the Developer tab, click Macros, select 'SwitchLanguages', and click Run. The document will immediately hide one language and display the other.

Use a VBA Macro to Toggle Paragraph Styles
Adjusting Style Levels: If you are using fewer than nine style levels (e.g., only up to Text3English), change the loop limit in the VBA code from '9' to your highest defined level to prevent errors.

Manage Multilingual Documents Seamlessly in WPS Writer

WPS Writer offers an intuitive interface for managing custom paragraph styles and formatting, making it effortless to organize and control the visibility of bilingual document content. Its robust feature set also fully supports standard VBA macros for automation.

  1. 1. Open your Document: Launch WPS Writer and open your bilingual document.
  2. 2. Manage Paragraph Styles: Use the Styles pane (Home tab > Styles) to easily create and apply your dedicated English and Italian text styles.
  3. 3. Run VBA Macros: Navigate to the Developer tab to insert and run your VBA toggle macros natively, instantly switching your document's visible language.
Seamlessly compatible with Microsoft Word styles (.docx)User-friendly Styles and Formatting pane for quick editingSupports advanced field codes and document properties for dynamic textLightweight, fast, and free alternative for everyday document editing
microsoft office alternative - wps office

Frequently Asked Questions

Can I adapt the macro to support more than two languages?

Yes. You can create additional styles (e.g., 'Text1French') and modify the VBA IF/ELSE logic to cycle through three or more languages by setting the .Font.Hidden property accordingly.

Why is the hidden text still printing on my document?

Word has a specific print setting for hidden text. To fix this, go to File > Options > Display, and ensure that the 'Print hidden text' checkbox is unchecked under the Printing options section.

What happens if I forget to create one of the numbered styles?

If the macro loops through a style name that doesn't exist (like 'Text4English'), it will throw a 'Style not found' error. Always ensure your VBA loop limit matches the exact number of custom styles you have created.

Does this method delete the hidden text?

No, the text is completely safe. The macro only changes the 'Hidden' font attribute of the paragraph style. Running the 'ShowBoth' macro will immediately make all text visible again.