DocumentBase.SetLetterContent, méthode

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word.v4.0.Utilities (dans Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Déclaration
Public Sub SetLetterContent ( _
    ByRef letterContent As Object _
)
public void SetLetterContent(
    ref Object letterContent
)

Paramètres

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 méthode SetDefaultTableStyle. Pour utiliser cet exemple, exécutez-le à partir de la classe ThisDocument dans un projet au niveau du document.

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
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);
}

Sécurité .NET Framework

Voir aussi

Référence

DocumentBase Classe

Microsoft.Office.Tools.Word, espace de noms