Click or drag to resize
TextFontCopyFrom Method
Sets the character formatting by copying another text font object.

Namespace: TextObjectModel
Assembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax
public void CopyFrom(
	TextFont other
)

Parameters

other
Type: TextObjectModelTextFont
The text font object to apply to this font object.
Exceptions
ExceptionCondition
ArgumentNullExceptionother is null.
Examples
The following example demonstrates how to copy character formatting from one range to another:
C#
void CopyFromExample(TextDocument document) {
    TextRange range = document.EntireRange;
    range.Text = "One Two";

    // "One" is bold
    range.FindText("One");
    range.Font.Bold = true;

    // "Two" is bold italic
    TextRange copy = range.Clone();
    copy.FindText("Two");
    copy.Font.CopyFrom(range.Font);
    copy.Font.Italic = true;
}
See Also