How to Prevent Word from Encoding Curly Braces in Salesforce URLs
Question details
The user needs to stop Microsoft Word from automatically URL-encoding curly braces in hyperlinks, which breaks Salesforce merge fields.

- 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 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.
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.
Enter the standard portion of your web link into the Word document, omitting any Salesforce merge fields or curly braces.
Press the Spacebar or Enter key to allow Microsoft Word to recognize the text and convert it into a clickable, blue hyperlink.
Right-click the newly created link and select 'Edit Hyperlink' from the context menu.
In the 'Address' field at the bottom of the dialog box, manually type your required {{ }} Salesforce merge fields, then click 'OK'.

Construct Links in a Plain Text Editor
Use an external plain text editor to build your URLs, completely avoiding Microsoft Word's automated formatting engine.
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. Download WPS Office: Visit the official WPS Office website and click the free download button.
- 2. Install the Software: Run the installation package and follow the quick setup wizard.
- 3. Open Your Templates: Launch WPS Writer and open your existing .docx files to continue working immediately.

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.




