---
schema_version: "1"
id: 4bc2e57fd702fa4ea5432ddbc99d12bdf5356689ec2e085b3f41949fd3aa7b0a
title: View Archived Content Documents Under Non-Archived Emails
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/archive_o_view_nonarchived_emails_content_docs.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.archive_o_view_nonarchived_emails_content_docs.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e306a3b6396f029d31fe8d69dbab0dfdd3e5709afb7684999cbb8729b313e7c4
description: Configure a Visualforce page that displays email messages alongside their related archived Content Documents within the CustomListRelatedRecordArchivedWidget and CustomSingleRelatedRecordArchivedWidget in the Archive managed package.
products:
  - Security
  - Salesforce Platform
release: "264"
---
# View Archived Content Documents Under Non-Archived Emails

Configure a Visualforce page that displays email messages alongside their related archived Content Documents within the `CustomListRelatedRecordArchivedWidget` and `CustomSingleRelatedRecordArchivedWidget` in the Archive managed package.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

The instructions apply to both Salesforce Classic and Lightning Experience.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note

You must have access to Visualforce pages.

1. Create a Visualforce Page.
    1. Click **New** to create a Visualforce page for the selected email object.
    2. Enter a Label for the page.
        
        Example: `archiverecords_for_email_message`
    3. Enter a Name.
        
        Use underscores instead of spaces.
        
        Example: `archiverecords_for_email_message`
    4. In the Visualforce Markup section, enter this code.
        
        ```
        
                                        <apex:page standardController="EmailMessage">
                                        <apex:includeLightning />
                                        <div id="lightning" />
                                        <div id="showErrornotSuported"></div>
                                        
                                        <style>
                                        lightning-breadcrumb.slds-breadcrumb__item {
                                        text-align: center !important;
                                        }
                                        
                                        .toastModel {
                                        height: 4rem !important;
                                        position: fixed !important;
                                        top: 0rem !important;
                                        left: 50% !important;
                                        transform: translateX(-50%) !important;
                                        z-index: 100000 !important;
                                        }
                                        </style>
                                        
                                        <script>
                                        let lwcArchiverApp = "OB_Archiver:lwcWrapperAppForVisualforce";
                                        let widgetComp = "OB_Archiver:CustomRelatedSingleResults";
                                        $Lightning.use(lwcArchiverApp, function () {
                                        $Lightning.createComponent(widgetComp,
                                        {
                                        recordId: "{!<a href="http://EmailMessage.Id" rel="noopener" target="_blank">EmailMessage.Id</a>}",
                                        objectApiName: "EmailMessage",
                                        defaultChildObject: "ContentDocument"
                                        },
                                        "lightning",
                                        function (cmp) {
                                        }
                                        );
                                        });
                                        </script>
                                        </apex:page>
                                    
        ```
    5. Click **Save**.
2. Add the widget to the Page Layout in Salesforce Classic.
    1. In Setup, go to the object's layout and click **Edit Layout**.
    2. Create a section in the object layout.
    3. From the Components menu, select the Visualforce Page option.
    4. In Section Properties, select either `CustomListRelatedRecordArchivedWidget` or `CustomSingleRelatedRecordArchivedWidget`, or both.
    5. Enter a Section Name for the new section.
    6. Check the **Detail Page** checkbox and select **1-Column**.
    7. Drag the page to the new section.
    8. Click the Properties icon on the Visualforce page.
        
        Set the Height to `500` and turn on the **Show Scrollbars** option.
    9. Click **Save**.
        
        The new widgets are now visible on the page layout.
3. Verify the Display
    1. Go to an EmailMessage record in Archive.
    2. The widget displaying the archived Content Document is now visible.
    3. The content of the archived document, fetched from Archive, appears under the Details tab.