Formatting Issues

How to Prevent Word from Encoding Curly Braces in Salesforce URLs

Algirdas JasaitisAlgirdas Jasaitis Oct 21, 2026 868 views

Question details

The user needs to stop Microsoft Word from automatically URL-encoding curly braces in hyperlinks, which breaks Salesforce merge fields.

How to Prevent Word from Encoding Curly Braces in Salesforce URLs
Product
Microsoft Word
Device & OS
not provided
Scenario
Creating or copying document templates that contain hyperlinks with Salesforce merge fields.
Observed behavior
Microsoft Word automatically alters the curly braces ({{ }}) to their URL-encoded equivalents (%7b and %7d), rendering the merge fields completely dysfunctional in Salesforce.
Before you start

Before proceeding, confirm the exact syntax your Salesforce merge fields require and ensure you have administrative access to test the modified templates directly within your Salesforce environment.

Solution 1Recommended

Insert the Merge Field After Creating the Link

Bypass Word's automatic encoding by adding the curly braces into the hyperlink address only after the base URL has been created.

Microsoft Word scans for web-compliant URLs as you type. If you include special characters during the initial link creation, Word's formatting engine will automatically encode them. Adding the merge fields retroactively prevents this trigger.

1
Type the Base URL

Enter the standard portion of your web link into the Word document, omitting any Salesforce merge fields or curly braces.

2
Generate the Hyperlink

Press the Spacebar or Enter key to allow Microsoft Word to recognize the text and convert it into a clickable, blue hyperlink.

3
Edit the Hyperlink

Right-click the newly created link and select 'Edit Hyperlink' from the context menu.

4
Insert the Curly Braces

In the 'Address' field at the bottom of the dialog box, manually type your required {{ }} Salesforce merge fields, then click 'OK'.

Insert the Merge Field After Creating the Link
Testing the Link: Always paste the resulting link into a test Salesforce template to verify that the merge field remains unencoded and functions properly.
Free Microsoft Office alternative

Edit Professional Templates Seamlessly with WPS Office

If Microsoft Word's aggressive auto-formatting is slowing down your workflow, consider switching to WPS Office. It provides a familiar, lightweight, and highly compatible environment for managing your daily document tasks without the premium cost.

  1. 1. Download WPS Office: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Software: Run the installation package and follow the quick setup wizard.
  3. 3. Open Your Templates: Launch WPS Writer and open your existing .docx files to continue working immediately.
Fully compatible with Microsoft Word (.docx) formats and templates.Provides greater control over text formatting and hyperlink behaviors.Lightweight, fast, and completely free to download.Familiar user interface makes document migration instantaneous.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Microsoft Word change my curly braces to %7b and %7d?

In standard web protocols, curly braces are considered reserved characters. Word automatically URL-encodes these characters into their hexadecimal equivalents (%7b for the left brace and %7d for the right brace) to ensure the hyperlink is technically valid for web browsers.

Can I completely disable automatic URL encoding in Microsoft Word?

No, Microsoft Word currently does not provide a built-in toggle or setting to turn off automatic URL encoding for hyperlinks. Users must rely on workarounds, such as editing the hyperlink address after it has been created.

Will my Salesforce template still work if the curly braces are encoded?

Generally, no. Salesforce's internal processing engine requires the exact {{ }} syntax to recognize and populate merge fields. If it reads %7b and %7d instead, the system treats it as standard text and the link integration will fail.