ITextRange.Copy method

Applies to Windows and Windows Phone

Copies the text of the text range to the Clipboard.

Syntax


void Copy()

Parameters

This method has no parameters.

Remarks

Note  On Windows Phone, this method throws an exception. Programmatic access to the clipboard is not supported on Windows Phone.

The ITextRange.Cut, Copy, and Paste methods let you perform the usual cut, copy, and paste operations on a text range. The clipboard formats that are typically supported include CF_TEXT and CF_RTF. You can also use private clipboard formats to access text in custom formats.

To copy and replace plain text, you can use the ITextRange.GetText and SetText methods. To copy formatted text from one range to another without using the Clipboard, you can use the Copy and Paste methods along with the FormattedText property. For example:


textRange2.FormattedText = textRange1.FormattedText;


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.winmd

See also

ITextRange
ITextRange.Cut
ITextRange.Paste

 

 

Show:
© 2014 Microsoft