Classic .doc Generation (DOC/DOC-NEW)
Use legacy DOC and DOC-NEW formats, understand preview behavior, fix common RTF issues, and add page numbers.
Last updated
Was this helpful?
Use legacy DOC and DOC-NEW formats, understand preview behavior, fix common RTF issues, and add page numbers.
Use this page when you maintain legacy DOC or DOC-NEW templates.
These formats generate Word-compatible output from HTML-based template content.
They are not true binary .doc files.
Choose Microsoft Word (DOCX) when you need true .docx output and Word-native template design.
DOC and DOC-NEW are legacy Word-compatible formats.
They render from the HTML created in the template editor.
That lets S-Docs turn template markup directly into a file Microsoft Word can open.
In practice, the generated file is Word-compatible rather than a true DOC binary.
That is why Word usually opens the file without issue, even when Salesforce preview behavior is inconsistent.
Salesforce file preview does not reliably render DOC-NEW output.
It can display the file encoding or underlying source instead of the expected document.
This happens because Salesforce does not properly preview the MHT-style structure used for these files.
If preview shows raw content, send users a direct download link instead of the standard file preview link.
Example pattern:
You can use the same pattern with a my.salesforce.com domain if needed.
DOC-NEW can remove the next two characters after an equals sign inside an RTF field.
This can affect normal text and URLs.
Example:
Input: something = something
Output: something =omething
Use this replacement to avoid the issue:
Apply that fix in the affected RTF field.
To add page numbers like Page 1 of 3, place this markup in the template footer:
Microsoft Word resolves those field codes when the file opens.
Keep these legacy format rules in mind:
DOC and DOC-NEW are HTML-based Word-compatible outputs
Salesforce preview may not render DOC-NEW correctly
direct download is the safest delivery pattern for DOC-NEW
some legacy RTF patterns need workarounds
page numbering works through Word field-code markup
Use Microsoft Word (DOCX) for new Word-based implementations when you need:
true .docx output
Word-native layout and styling
clearer long-term support patterns
fewer preview and legacy format edge cases
Last updated
Was this helpful?
Was this helpful?
https://your-domain.lightning.force.com/sfc/servlet.shepherd/version/download/<LatestPublishedVersionId>replaceAll="= ,=XX "<strong>Page <span style="mso-field-code: PAGE ">
</span> of <span style="mso-field-code: NUMPAGES "></span></strong>
