Diagnose and repair broken file associations, Protected View corruption, and encoding issues that cause Word docs to display as garbled characters.
Complexity: Intermediate. Impact: troubleshooting + end-user-support + microsoft-365 + file-associations + office-repair.
Why use this workflow
When a user double-clicks a .docx or .doc file and sees a page full of symbols, mojibake, or XML markup instead of formatted text, it is almost always one of a handful of issues:
- The file extension is associated with the wrong application (e.g., Notepad, WordPad, or a browser) rather than Microsoft Word.
- Word's Protected View or Office click-to-run cache is corrupted.
- The document was downloaded with the wrong MIME type or transferred in binary-unsafe mode and is genuinely corrupt.
- A third-party app (often a PDF reader or a legacy Office viewer) has hijacked the
.docxhandler. - The user is on a machine where Office was uninstalled or never installed, and the OS fell back to a text editor.
Run this workflow when a user says "my Word docs look like code", "I see weird symbols when I open a document", or "everything opens in Notepad now".
Expected outcomes
- Word documents open in Microsoft Word by default on the affected machine.
- The
.docx,.doc,.docm,.rtf, and related extensions are registered to the correct Word executable. - Office installation integrity is verified (Quick Repair or Online Repair completed).
- You have confirmed whether the specific document is genuinely corrupt or whether the issue was local to the user's machine.
- The user can double-click documents and see formatted content.
Risks and considerations
- Do not edit the registry blindly. File association keys under
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExtshave aUserChoicesubkey protected by a hash. Deleting or malforming it can leave the extension with no handler at all. - Online Repair downloads the full Office installer and can take a while. Warn the user and save their work first.
- If the file looks like XML markup (
<?xml ...and<w:document>tags), the user may have opened a raw.docxthat was renamed from a.zip, or their editor is showing the internal Open XML. This is not corruption. - If the file looks like random binary/symbols across every Word doc, suspect a font cache issue or a machine-wide encoding problem, not a single-file problem.
- Do not tell a user to just "reinstall Office" without first trying Quick Repair. A reinstall costs time and loses their add-ins.
- Ransomware consideration: if many documents across the machine or a file share suddenly look like gibberish, stop and investigate for ransomware encryption before attempting repairs.
Required permissions
| Permission | Why it's needed |
|---|---|
| Local Administrator on the affected device | Required to run Office Repair, reset file associations system-wide, and modify HKLM registry keys. |
| Intune Device Configuration (Read/Write) | Optional: to deploy a default file associations XML policy tenant-wide. |
| DeviceManagementConfiguration.ReadWrite.All (Graph) | If automating the fix via Intune remediation script deployment. |
Ask Dex
Paste the prompt into a Dex conversation.
Prompt for IT admins
{user} reports that when they double-click a Word document it opens as a page of gibberish / symbols. Diagnose whether this is a file association issue, Protected View cache corruption, or document corruption, then apply the fix (reset .docx association to Word, clear Protected View cache, run Office Quick Repair) on their device and confirm they can open Word documents normally.
How an end user can ask Dex
When I double-click my Word documents they open as a page full of weird symbols and code instead of my text. Can you fix it?
Manual steps (admin center)
Step 1: Confirm the symptom
- Ask the user to send you a screenshot of the "gibberish". Look for tell-tale patterns:
- Text starting with
PKfollowed by binary: the.docxopened in a text editor (association problem). - Text starting with
<?xml version="1.0": raw Open XML, likely a renamed or extracted file. - Mojibake like
éor�: encoding mismatch on a.txtor.csvsaved from Word. - Random high-ASCII symbols across all fonts: possible font cache corruption.
- Text starting with
Step 2: Reset the file association
- Open Settings > Apps > Default apps.
- In the search box type
.docx. - Click the current default app and select Word (or Word (desktop) if both Word and Word Online are listed).
- Repeat for
.doc,.docm,.dotx,.dotm, and.rtf. - Have the user double-click a known-good document to test.
Step 3: Run Office Quick Repair
- Open Settings > Apps > Installed apps.
- Find Microsoft 365 (or Microsoft Office), click the … menu, and choose Modify.
- Select Quick Repair and click Repair. Quick Repair does not require internet.
- Test opening a document. If still broken, repeat and choose Online Repair (requires internet).
Step 4: Clear Protected View / trusted locations if the issue is only with downloaded files
- Open Word, then go to File > Options > Trust Center > Trust Center Settings > Protected View.
- Temporarily uncheck all three Protected View options, click OK, and test. If the document opens correctly, re-enable Protected View. The original issue was likely a transient Protected View cache problem that is now cleared.
Step 5: Test the document on another machine
If after all of the above the same document still displays as gibberish but other Word docs open fine, the document itself is corrupt. In Word, go to File > Open, browse to the file, click the dropdown arrow next to Open, and choose Open and Repair.
Microsoft Graph API
Not directly applicable for the diagnosis itself. File associations and Office repair are local-machine operations, not cloud API calls.
However, if you want to deploy a fix at scale via Microsoft Graph, you can push an Intune device configuration profile that sets default file associations. Example:
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.windows10CustomConfiguration",
"displayName": "Default File Associations - Word",
"omaSettings": [{
"@odata.type": "#microsoft.graph.omaSettingString",
"displayName": "DefaultAssociationsConfiguration",
"omaUri": "./Vendor/MSFT/Policy/Config/ApplicationManagement/DefaultAssociationsConfiguration",
"value": "<base64-encoded DefaultAssociations.xml>"
}]
}The XML payload maps each extension to the Word ProgID (Word.Document.12 for .docx).
For the interactive troubleshooting of a single user's machine, use the PowerShell or manual path instead.
PowerShell
A scripted fix follows this sequence:
- Detect the installed Word executable path.
- Reset file associations for
.docx,.doc,.docm,.dotx,.rtfto the Word ProgID usingDism /Online /Import-DefaultAppAssociations(the supported method that does not break the UserChoice hash). - Clear the user's Word Protected View cache.
- Trigger an Office Click-to-Run Quick Repair non-interactively.
- Log every step to a local log file.
Run the fix elevated on the affected machine. A detection-only variant of the same logic can be used as an Intune Proactive Remediation detection script, with the full fix as the remediation script.