# Render attachments Render email attachments with GroupDocs.Viewer for .NET in the same way as you would render any other documents Render attachments in the same way as any other documents. To view attachments, follow these steps: 1. Instantiate the first [Viewer](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/viewer) object. Specify a file that contains attachments. 2. Call the [SaveAttachment](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/viewer/methods/saveattachment) method to save the attachment (to local disk, memory stream, etc). 3. Instantiate the second [Viewer](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/viewer) object. Specify the previously saved attachment. 4. Specify the view options depending on the output format - [HtmlViewOptions](https://reference.groupdocs.com/net/viewer/groupdocs.viewer.options/htmlviewoptions)/[PngViewOptions](https://reference.groupdocs.com/net/viewer/groupdocs.viewer.options/pngviewoptions)/[JpgViewOptions](https://reference.groupdocs.com/net/viewer/groupdocs.viewer.options/jpgviewoptions)/[PdfViewOptions](https://reference.groupdocs.com/net/viewer/groupdocs.viewer.options/pdfviewoptions). 5. Call the [View](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/viewer/methods/view) method. The following code snippet shows how to render attachments from the MSG file: {{< alert style="info" >}}NOTE: provided code snippet suits all format families that support attachments: emails, Outlook data files, archives, and PDF documents.{{< /alert >}} {{< tabs "convert-and-view-attachments">}} {{< tab "C#" >}} ```csharp using System.IO; using GroupDocs.Viewer; using GroupDocs.Viewer.Options; using GroupDocs.Viewer.Results; // ... // Specify attachment. Attachment attachment = new Attachment("delivery-note-0912.xlsx", "delivery-note-0912.xlsx"); // Create a stream for attachment. MemoryStream attachmentStream = new MemoryStream(); //Save attachment using (Viewer viewer = new Viewer("sample.msg")) { viewer.SaveAttachment(attachment, attachmentStream); } // Render attachment using (Viewer viewer = new Viewer(attachmentStream)) { HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(); viewer.View(options); } ``` {{< /tab >}} {{< tab "VB.NET">}} ```vb Imports System.IO Imports GroupDocs.Viewer Imports GroupDocs.Viewer.Options Imports GroupDocs.Viewer.Results ' ... Module Program Sub Main(args As String()) ' Specify attachment. Dim attachment As Attachment = New Attachment("delivery-note-0912.xlsx", "delivery-note-0912.xlsx") ' Create a stream for attachment. Dim attachmentStream As MemoryStream = New MemoryStream() 'Save attachment Using viewer As Viewer = New Viewer("sample.msg") viewer.SaveAttachment(attachment, attachmentStream) End Using ' Render attachment Using viewer As Viewer = New Viewer(attachmentStream) Dim options As HtmlViewOptions = HtmlViewOptions.ForEmbeddedResources() viewer.View(options) End Using End Sub End Module ``` {{< /tab >}} {{< tab "sample.msg" >}} {{< tab-text >}} `sample.msg` is the sample file used in this example. Click [here](https://docs.groupdocs.com/viewer/net/_sample_files/developer-guide/processing-attachments/how-to-convert-and-view-attachments/sample.msg) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "p_1.html" >}} ```text HTML file (52 KB) ``` [Download full output](https://docs.groupdocs.com/viewer/net/_output_files/developer-guide/processing-attachments/how-to-convert-and-view-attachments/ConvertAndViewAttachments/p_1.html) {{< /tab >}} {{< /tabs >}}