DocumentBase.SetLetterContent(Object) Méthode

Définition

public void SetLetterContent (ref object letterContent);

Paramètres

letterContent
Object

Exemples

L’exemple de code suivant crée un nouveau style de table et l’ajoute au modèle attaché au document à l’aide de la SetDefaultTableStyle méthode. Pour utiliser cet exemple, exécutez-le à partir de la ThisDocument classe dans un projet au niveau du document.

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

S’applique à