# sfrichtextboxadv-create-letters

> SfRichTextBoxAdv with mail-merge letter templates, recipient selection, and rich formatting.

**Framework:** wpf  **Component:** RichTextEditor  **Variant:** create-letters

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/wpf/sfrichtextboxadv-create-letters.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.SfRichTextBoxAdv.WPF
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/sfrichtextboxadv-create-letters/SfRichTextBoxAdv.xaml

```xaml
<UserControl x:Class="syncfusion.richtextboxadvdemos.wpf.CreateLetters.SfRichTextBoxAdv"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Syncfusion="http://schemas.syncfusion.com/wpf"
        xmlns:RichTextBoxAdv="clr-namespace:Syncfusion.Windows.Controls.RichTextBoxAdv;assembly=Syncfusion.SfRichTextBoxAdv.Wpf"
        x:Name="ribbonWindow" Unloaded="OnSampleUnloaded">

    <Grid x:Name="Root">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Syncfusion:SfRichTextRibbon x:Name="richTextRibbon" Grid.Row="0" SnapsToDevicePixels="True"
                                      DataContext="{Binding ElementName=richTextBoxAdv}"/>

        <!-- Recipient Selection (below the ribbon so it is never overlapped) -->
        <Border Grid.Row="1" Padding="10,6" Background="#F0F0F0" BorderBrush="#FFD0D0D0" BorderThickness="0,1,0,1">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <TextBlock Text="Select Recipient: " VerticalAlignment="Center" FontSize="14" Margin="0,0,10,0"/>
                <ComboBox x:Name="RecipientsComboBox" Width="300" Height="26"
                          FontSize="13" VerticalContentAlignment="Center"
                          SelectionChanged="RecipientsComboBox_SelectionChanged"/>
            </StackPanel>
        </Border>

        <!-- SfRichTextBoxAdv with UIContainerAdv for mail merge -->
        <Syncfusion:SfRichTextBoxAdv x:Name="richTextBoxAdv" Grid.Row="2"
                                      Background="#F1F1F1" BorderBrush="#0E000000" BorderThickness="1"
                                      LayoutType="Pages" AcceptsTab="True" AllowDrop="True">
            <Syncfusion:SfRichTextBoxAdv.SpellChecker>
                <RichTextBoxAdv:SpellChecker IsEnabled="True"/>
            </Syncfusion:SfRichTextBoxAdv.SpellChecker>
            <Syncfusion:DocumentAdv>
                <Syncfusion:DocumentAdv.ParagraphFormat>
                    <Syncfusion:ParagraphFormat LeftIndent="0" RightIndent="0" FirstLineIndent="0"
                                                TextAlignment="Left" AfterSpacing="0" BeforeSpacing="0"
                                                LineSpacing="1" LineSpacingType="Multiple" Bidi="False"/>
                </Syncfusion:DocumentAdv.ParagraphFormat>
                <Syncfusion:SectionAdv>
                    <Syncfusion:SectionAdv.SectionFormat>
                        <Syncfusion:SectionFormat PageSize="816 1056" PageMargin="72 96 72 96"
                                                  HeaderDistance="48" FooterDistance="48"/>
                    </Syncfusion:SectionAdv.SectionFormat>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.CharacterFormat>
                            <Syncfusion:CharacterFormat FontSize="22" FontFamily="Segoe UI" Bold="True"/>
                        </Syncfusion:ParagraphAdv.CharacterFormat>
                        <Syncfusion:SpanAdv Text="Create Letters - Mail Merge"/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="12" AfterSpacing="12"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:SpanAdv Text="Date: "/>
                        <Syncfusion:SpanAdv x:Name="dateSpan" Text=""/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:SpanAdv Text="To,"/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtName" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtCompany" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtAddress" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtCityRegion" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtCountry" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtPhone" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:UIContainerAdv Height="25" Width="260">
                            <TextBox x:Name="txtFax" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:SpanAdv Text="Dear "/>
                        <Syncfusion:UIContainerAdv Height="25" Width="120">
                            <TextBox x:Name="greetingSpan" FontSize="14" FontFamily="Segoe UI"
                                      Background="Transparent" Padding="0"/>
                        </Syncfusion:UIContainerAdv>
                        <Syncfusion:SpanAdv Text=","/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="10" AfterSpacing="0" LineSpacing="1" LineSpacingType="Multiple"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:SpanAdv Text="We are pleased to inform you about our latest products and services. This letter demonstrates the mail merge capabilities of SfRichTextBoxAdv combined with the ribbon interface."/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:ParagraphAdv.ParagraphFormat>
                            <Syncfusion:ParagraphFormat BeforeSpacing="24"/>
                        </Syncfusion:ParagraphAdv.ParagraphFormat>
                        <Syncfusion:SpanAdv Text="Sincerely,"/>
                    </Syncfusion:ParagraphAdv>
                    <Syncfusion:ParagraphAdv>
                        <Syncfusion:SpanAdv Text="Syncfusion Inc."/>
                    </Syncfusion:ParagraphAdv>
                </Syncfusion:SectionAdv>
            </Syncfusion:DocumentAdv>
        </Syncfusion:SfRichTextBoxAdv>
    </Grid>
</UserControl>
```
