| TextFontCopyFrom Method |
Sets the character formatting by copying another text font object.
Namespace: TextObjectModelAssembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax public void CopyFrom(
TextFont other
)
Public Sub CopyFrom (
other As TextFont
)
public:
void CopyFrom(
TextFont^ other
)
Parameters
- other
- Type: TextObjectModelTextFont
The text font object to apply to this font object.
Exceptions Examples
The following example demonstrates how to copy character formatting
from one range to another:
void CopyFromExample(TextDocument document) {
TextRange range = document.EntireRange;
range.Text = "One Two";
range.FindText("One");
range.Font.Bold = true;
TextRange copy = range.Clone();
copy.FindText("Two");
copy.Font.CopyFrom(range.Font);
copy.Font.Italic = true;
}
See Also