Version

Import/Export DOCX (xamRichTextEditor)

Topic Overview

Purpose

This topic explains how to use the xamRichTextEditor ™ control for importing and exporting DOCX formatted data.

Required background

The following topic is a prerequisite to understanding this topic:

Topic Purpose

This topic explains the xamRichTextEditor control’s serialization providers.

Import/Export MS Word Configuration Summary

Import/Export configuration summary chart

The following table briefly explains the configurable aspects of the xamRichTextEditor control and maps them to their respective properties.

Configurable aspect Details Methods

Import MS Word content from a stream.

Export MS Word content to a stream.

Note
Note

You must first include the MS Word serialization provider NuGet package in your project prior to being able to use it:

Infragistics.WPF.RichTextDocument.Word

Import MS Word Content

Overview

Use the LoadFromWord extension method of the RichTextDocument to import MS Word content in the xamRichTextEditor control from a stream.

Property settings

The following table maps the desired configuration to its respective property settings.

In order to: Use this method: And provide the following arguments:

Import MS Word content

LoadFromWord

  • The stream object containing the MS Word format content

  • Content loading options object of type WordLoadOptions, which is not required

Export MS Word Content

Overview

Use the SaveToWord extension method of the RichTextDocument to export xamRichTextEditor’s content to a stream in MS Word format.

Property settings

The following table maps the desired configuration to its respective property settings.

In order to: Use this method: And provide the following arguments:

Export content in MS Word format

SaveToWord

  • The stream object into which to export the content in MS Word format

  • Content saving options object of type WordSaveOptions, which is not required

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to import and export of plain text data using the xamRichTextEditor control.

This topic explains how to use the xamRichTextEditor control for importing and exporting RTF data.