Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ClipboardProxy.GetText Method

Definition

Namespace:
Microsoft.VisualBasic.MyServices
Assembly:
Microsoft.VisualBasic.dll
Assembly:
Microsoft.VisualBasic.Forms.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Retrieves text from the Clipboard.

Overloads

Name Description
GetText(TextDataFormat)

Retrieves text from the Clipboard.

GetText()

Retrieves text from the Clipboard.

GetText(TextDataFormat)

Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb

Retrieves text from the Clipboard.

public:
 System::String ^ GetText(System::Windows::Forms::TextDataFormat format);
public string GetText(System.Windows.Forms.TextDataFormat format);
member this.GetText : System.Windows.Forms.TextDataFormat -> string
Public Function GetText (format As TextDataFormat) As String

Parameters

format
TextDataFormat

TextDataFormat. If specified, identifies what text format should be retrieved. Default is CommaSeparatedValue. Required.

Returns

The Clipboard text data or an empty string if the Clipboard does not contain data in the specified format.

Examples

This example reads text from the Clipboard into the string textOnClipboard.

Dim textOnClipboard As String = My.Computer.Clipboard.GetText()

This example fails if there is no text on the Clipboard.

Remarks

Possible formats are CommaSeparatedValue, Html, Rtf and UnicodeText.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No

See also

Applies to

GetText()

Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb

Retrieves text from the Clipboard.

public:
 System::String ^ GetText();
public string GetText();
member this.GetText : unit -> string
Public Function GetText () As String

Returns

The Clipboard text data or an empty string if the Clipboard does not contain data in the Text or UnicodeText format, depending on the operating system.

Examples

This example reads text from the Clipboard into the string textOnClipboard.

Dim textOnClipboard As String = My.Computer.Clipboard.GetText()

This example fails if there is no text on the Clipboard.

Remarks

Possible formats are CommaSeparatedValue, Html, Rtf and UnicodeText.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No

See also

Applies to


Feedback

Was this page helpful?