DocumentBase.SetLetterContent Method
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public Sub SetLetterContent ( _
ByRef letterContent As Object _
)
public void SetLetterContent(
ref Object letterContent
)
Parameters
- letterContent
Type: System.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 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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.