Поделиться через


DocumentBase.SetLetterContent - метод

Пространство имен:  Microsoft.Office.Tools.Word
Сборка:  Microsoft.Office.Tools.Word.v4.0.Utilities (в Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Синтаксис

'Декларация
Public Sub SetLetterContent ( _
    ByRef letterContent As Object _
)
public void SetLetterContent(
    ref Object letterContent
)

Параметры

Примеры

В приведенном ниже примере кода создается новый стиль таблицы, и он добавляется в шаблон, присоединенный к документу, с помощью метода SetDefaultTableStyle. Чтобы использовать этот пример, запустите его из класса ThisDocument в проекте уровня документа.

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

Безопасность платформы .NET Framework

См. также

Ссылки

DocumentBase Класс

Microsoft.Office.Tools.Word - пространство имен