DocumentBase.SetLetterContent(Object) Method

Definition

public:
 void SetLetterContent(System::Object ^ % letterContent);
public void SetLetterContent (ref object letterContent);
member this.SetLetterContent : obj -> unit
Public Sub SetLetterContent (ByRef letterContent As Object)

Parameters

letterContent
Object

Examples

The following code example creates a new table style and adds it to the template attached to the document by using the SetDefaultTableStyle method. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentSetDefaultTableStyle()
{
    // Create a new table style.
    object tableStyle = Word.WdStyleType.wdStyleTypeTable;
    Word.Style newStyle = this.Styles.Add("TableStyle1", 
        ref tableStyle);

    // Set a property of the new style.
    newStyle.Font.Color = Word.WdColor.wdColorBlueGray;

    // Set this style as the default for tables in the document.
    object inputStyle = newStyle;
    this.SetDefaultTableStyle(ref inputStyle, true);
}
Private Sub DocumentSetDefaultTableStyle()
    ' Create a new table style.
    Dim newStyle As Word.Style = Me.Styles.Add("TableStyle1", _
        Word.WdStyleType.wdStyleTypeTable)

    ' Set a property of the new style.
    newStyle.Font.Color = Word.WdColor.wdColorBlueGray

    ' Set this style as the default for tables in the document.
    Dim inputStyle As Object = newStyle
    Me.SetDefaultTableStyle(inputStyle, True)
End Sub

Applies to