Windows copy and paste text

Copy and paste

This article explains how to support copy and paste in Universal Windows Platform (UWP) apps using the clipboard. Copy and paste is the classic way to exchange data either between apps, or within an app, and almost every app can support clipboard operations to some degree. For complete code examples that demonstrate several different copy and paste scenarios, see the clipboard sample.

Check for built-in clipboard support

In many cases, you do not need to write code to support clipboard operations. Many of the default XAML controls you can use to create apps already support clipboard operations.

Get set up

First, include the Windows.ApplicationModel.DataTransfer namespace in your app. Then, add an instance of the DataPackage object. This object contains both the data the user wants to copy and any properties (such as a description) that you want to include.

Copy and cut

Copy and cut (also referred to as move) work almost exactly the same. Choose which operation you want by using the RequestedOperation property.

Set the copied content

Next, you can add the data that a user has selected to the DataPackage object. If this data is supported by the DataPackage class, you can use one of the corresponding methods of the DataPackage object. Here’s how to add text by using the SetText method:

The last step is to add the DataPackage to the clipboard by calling the static SetContent method.

Paste

To get the contents of the clipboard, call the static GetContent method. This method returns a DataPackageView that contains the content. This object is almost identical to a DataPackage object, except that its contents are read-only. With that object, you can use either the AvailableFormats or the Contains method to identify what formats are available. Then, you can call the corresponding DataPackageView method to get the data.

Track changes to the clipboard

In addition to copy and paste commands, you may also want to track clipboard changes. Do this by handling the clipboard’s ContentChanged event.

Control the formatting when you paste text

In Word, you can choose to paste text using the formatting of the source, destination, or just pure text. If you always want one of the options, set it as the default for pasted text.

Set default paste options

By default, Word preserves the original formatting when you paste content into a document using CTRL+V, the Paste button, or right-click + Paste. To change the default, follow these steps.

Go to File > Options > Advanced.

Under Cut, copy, and paste, select the down arrow for the setting to change .

Pasting within the same document When you paste content into the same document from which you copied the content.

Pasting between documents When you paste content that was copied from another Word document.

Pasting between documents when style definitions conflict When you paste content that was copied from another Word document, and the style that is assigned to the copied text is defined differently in the document where the text is being pasted.

Pasting from other programs When you paste content that was copied from another program, such as a browser.

Each setting has options you can set:

Keep Source Formatting
Merge Formatting
Keep Text Only

For more info on these options, see Get the look you want.

You can also select Set Default Paste from the Paste Options menu.

Change options when pasting content

When you copy content from a formatted source, such as a webpage or another Word document, you can select options at the time you paste it into your document.

Click or tap where you want to paste the content.

Press CTRL + V and then select Paste Options .

Hover over the buttons for a live review.

Select the paste option to use.

The Paste Options button lets you select formatting options and is on by default. If you don’t see the button, it might be turned off. Follow these steps to turn it on.

Go to File > Options > Advanced.

In the Cut, copy, and paste section, select Show Paste Options button when content is pasted.

If the setting is on but you don’t see the button when you paste, make sure you’re pasting formatted content, not pure text (like from NotePad.)

When you copy text from a Word document, webpage, or other app’s document and paste it into a Word document, you can choose how the text is formatted. You can keep the original formatting, merge with the destination formatting, or paste just plain text.

Keep Source Formatting (K) This option retains formatting that was applied to the copied text. Any style definition that is associated with the copied text is copied to the destination document.

Merge Formatting (M) This option discards most formatting that was applied directly to the copied text, but it retains formatting that is considered emphasis, such as bold and italic, when it is applied to only a portion of the selection. The text takes on the style characteristics of the paragraph where it is pasted. The text also takes on any direct formatting or character style properties of text that immediately precedes the cursor when the text is pasted.

Picture (U) This option is only available on Microsoft 365 Subscription. Converts text into an image and pastes that. The text can’t be changed, but you can treat it like any other picture or image and use effects, borders, or rotation. When selected, choose options from the Picture Format tab.

Keep Text Only (T) This option discards all formatting and nontext elements such as pictures or tables. The text takes on the style characteristics of the paragraph where it is pasted and takes on any direct formatting or character style properties of text that immediately precedes the cursor when the text is pasted. Graphical elements are discarded, and tables are converted to a series of paragraphs.

Читайте также:  Код для установки windows server 2012

When you paste items from a bulleted or numbered list into another list, you can keep their original formatting or sequence, or blend in with the numbering or bullets of the destination list.

Paste numbered items so the sequence continues Choose Continue List (C) to have inserted items stay in sequence in the list.

Keep original sequence on numbered items Choose New List (N) to have inserted items keep their original list sequence.

Paste bulleted items into a numbered list To keep the bullets, choose Keep Source Formatting (K). To convert bullets to numbers, choose Merge Formatting (M).

Paste numbered items into a bulleted list To keep the original numbers, choose Don’t Merge List (D). To convert the numbers to bullets, choose Merge List (M).

Paste Text Only lists By default, bullets and numbers are preserved when pasting text only. To turn this behavior off:

Go to File > Options > Advanced.

Clear Keep bullets and numbers when pasting text with Keep Text Only option.

How to Copy and Paste in the Windows 10 Command Prompt

By Melanie Pinola 20 November 2015

With Windows 10, Microsoft finally updated the long-neglected command prompt. You can now quickly select and paste text within the command prompt window, but first you have to enable the keyboard shortcuts. Here’s how to do it.

Previously if you wanted to copy and paste in the command prompt you had to jump through hoops: Open the context menu with the Alt+E keyboard combination, go to Edit > Mark to tell Windows you want to mark text to select, and then use a lasso tool to create a box around the text you wanted to select. You needed to go back into the context menu to copy and to paste.

The upgraded command prompt in Windows 10 is much simpler. You can copy and paste with the familiar CTRL + C to copy and CTRL + V to paste keyboard shortcuts. To get this functionality, head to the application’s properties settings.

1. Open Command Prompt. The quickest way to do this is to click the Windows key, type in cmd, and hit Enter or clicking on the app.

2. Right-click on the command prompt’s title bar and choose Properties

3. Uncheck the box next to «Use legacy console (requires relaunch)». This should automatically check the «Enable Ctrl key shortcuts» option.

4. Click OK.

Now you can select text using your mouse or the keyboard (hold down the Shift key and use the left or right arrows to select words). Press CTRL + C to copy it, and press CTRL + V to paste it in the window. You can also easily paste text you’ve copied from another program into the command prompt using the same shortcut.

Once you’ve got copying and pasting in the command prompt down, check out our guides on how to map a network drive to quickly share files and how to enter the BIOS to access critical settings.

Windows copy and paste text

Table of Contents

Introduction

A basic, but important, concept to understand when using a computer is cut, copy and paste. These actions will allow you to easily copy or move data between one application and another or copy and move files and directories from one location to another. Though the procedures in this tutorial are considered to be basic concepts, you would be surprised as to how many people do not understand these essential features. Even more importantly, once you understand these fundamentals you will be able to use this knowledge on almost any computer operating system as long as you know the corresponding keys that are used for these features. For the purpose of this tutorial I will cover how to cut, copy and paste with the Windows operating system. Other operating systems, such as Linux, Unix, and Apple support these concepts as well but will not be discussed in this tutorial.

Introducing the Windows Clipboard

Windows has a feature called the Windows Clipboard. The clipboard gives Windows users the ability to store information in memory and than retrieve that information for later use. The cut, copy and paste functions rely on the clipboard in order to work. The process of placing data into the clipboard is know as copying or cutting. The process of retrieving the data from that clipboard and placing it into another location is called pasting. We will cover the specifics on these actions in more detail later in the tutorial. For now it is important to understand that the clipboard is used to contain the data that you want to paste into another location. If there is no information contained in the clipboard, then you will not be able to paste anything. Any data that is stored in the clipboard via a copy or cut command will stay there until it is overwritten by another copy or cut command. When you paste that data, the data is not removed from the clipboard, and can be pasted over and over as many times as wish. The data in the clipboard will be erased, though, when you shut down or restart your computer.

How to highlight text in a document

Before you can copy, cut, or paste text data you must be able to highlight, or select, the text that you want to perform the action on. This is called highlighting and allows you to select all the information in a document or certain portions of it. Once the text is highlighted you can then copy or cut that information depending on your needs. An example of what highlighted text looks like is below:


Figure 1: Example of highlighted text

There are four standard methods used to highlight text and they are as follows:

Use your mouse Using your mouse to select text could not be any easier. Simply find the location you would like to start selecting from and place your mouse cursor there. Then press and hold the left mouse button and drag the cursor to the last area you would like to highlight. You will find that as your are holding the left mouse button and dragging the mouse cursor, the text between where you first pressed the button and where you dragged the cursor to will now be highlighted.
Use the applications edit menu to select all Windows applications that support copy and paste will usually contain an edit menu. Under this edit menu you will see an option to Select All. When you click on that menu option the entire contents of the file you are working for will be highlighted.
Right click your document Many programs give you the ability to select all the data in your document, as described above, by right-clicking on the document and then clicking on Select All. the entire contents of the file will now be highlighted.
Use your keyboard You can use your keyboard to select text by using the arrow keys while holding down the shift key. Place your cursor at the location you would like to start highlighting and then press and hold the shift key while you move your cursor with the keyboards arrow keys. As long as you are holding down the shift key, as you move the cursor with the arrow keys the data that you are moving the cursor over will become highlighted. Pressing Control+A When you press Control and then the letter A on your keyboard at the same time the program will select all the data in the document similar to how Select All works in the previous methods.

Читайте также:  Mac address windows cmd

Now that you know how to highlight text, you should practice the the art of highlighting text. You can do this by opening Notepad and typing in a few lines of text. Then practice the different methods of highlighting text. To open Notepad you can double-click its icon found in the Start Menu under the Accessories submenu.

How to select files and folders

Just as you can highlight, or select, text you can also highlight files and folders for use with the copy, cut, and paste commands. Selecting files and folders work a little differently then text though. When selecting text you must select the text so that the highlighted text is next to the other highlighted text. Files and folders, on the other hand, can be selected as seen fit and the files do not have to be next to each other. You can see an example of this in the figure below:


Figure 2. Select Files and Folders

As you can see from the image above, files and folder can be selected as needed and do not have to be right next to each other.

To select files or folder you can use the following methods:

Drag your mouse around the desired files or folders You can select multiple files and folders to work with by dragging the mouse cursor around these files. Simply left click in an empty space next to a folder, and while keeping your left mouse button pressed, drag your mouse to create a square or rectangle around those files or folder you want to select. As you drag the mouse, those items contained in the box will become selected. When you are done, release the left mouse button.
Use the applications edit menu to select all Windows applications that support copy and paste will usually contain an edit menu. Under this edit menu you will see an option to Select All. When you click on that menu option all the files in the folder you are looking at will become selected.
Use the Shift key The shift key is used to automatically select all the items between one selected item and another. Click once on a file or folder to select it. Then press and hold the shift key, and click again on another item. You will now see that all items between the first selected one and the next selected one will be highlighted. Use the Control The control key is used to choose individual items to be selected at the same time. Simply hold down the control key and, with that key held down, use your mouse to left click on other items to select . As long as the control is kept pressed down, you can choose as many individual items you would like to select at the same time.

To test this, open your My Documents folder and practicing selecting files and folders.

Copying text

What if you were working on a word processing document and you need to take text that is located in another document and add it to the current document. You could manually type the information found in the original document into the new document but that could take quite a long time. Luckily for us, operating systems give us the ability to copy text from one document to another document called Copy. When you copy highlighted data, this data is stored in the clipboard until you are ready to paste that data into another program

To copy something you must first highlight the text that you would like to copy using one of the methods described above. When when you have the text highlighted that you would like to copy, you can copy it to the clipboard in one of three ways:

  • When the text is highlighted you can press the Control button and the C button at the same to copy the data.
  • Right-clicking on the highlighted text or files and then clicking on Copy.
  • If there is an Edit menu you can click on Edit and then click on Copy.

Once you use one of these methods a duplicate of the highlighted text will be placed in the clipboard allowing you to paste it in another document or application.

Cutting text

Cutting is very similar to copy in that they both place the highlighted item into the clipboard for future pasting. The difference is that you when you Cut the highlighted text, it will remove, or cut, the highlighted text from the original location and place it into clipboard. It is therefore important to be careful when using this command as it is possible to lose data if you mistakenly cut the data from the document and then save the file.

Читайте также:  Windows 10 все приложения где папка

To cut text you must first highlight the text or data that you would like to cut using one of the methods described above. When when you have the text highlighted that you would like to cut, you can cut it to the clipboard in one of three ways:

  • When the text is highlighted you can press the Control button and the X button at the same to cut the data.
  • Right-clicking on the highlighted text and then clicking on Cut.
  • If there is an Edit menu you can click on Edit and then click on Cut.

Once you use one of these methods a copy of the highlighted text will be placed in the clipboard and the highlighted data will be removed from the document. It is important to note that the text will only be removed from a document if that document is editable. For example, you can not cut text from a document set to read-only or a web page because it is not editable.

Pasting text

Now that you know how to Copy and Cut data from a document and have it placed in the clipboard, you need to learn how to retrieve that data and place it in your document. Once data has been copied or cut from a document, you can then paste it into another document, or the same document, by retrieving that information from the clipboard using the Paste command.

Simply move your cursor to the location where you would like the data to be pasted into your document and then choose one of the methods for pasting the data.

  • When the cursor is at the location where you would like the data to be pasted press the Control button and the V button at the same to paste the data.
  • Right-clicking on the document and clicking on Paste.
  • If there is an Edit menu you can click on Edit and then click on Paste.

After you use one of the above commands the data contained in the clip board will now be pasted into the document.

Cut, Copy and Paste with Files and Folders

It is also possible to use the same key combinations and commands on files and folder. Simply select a file(s) or folder(s) and cut or copy it. Then you can select another location to paste it to. If you paste a copied file or folder in the same location that the original resides in, Windows will automatically append Copy of in front of the file name. For example if I copy and paste the file test.txt to the same directory the original is in, it will paste the file as a new file called Copy of test.txt.

When cutting files and folders, a duplicate of the file or folder will placed where you paste it to and the original will be deleted. Do not worry, though, as the original document you cut will not be deleted until a valid copy is pasted elsewhere.

Conclusion

Now that you know how to cut, copy and paste text and files from one location to another you have a powerful tool at your disposal. Now you can quickly take information from another document and paste it into a document of your choice. You also have the ability to cut or copy files from one location and place them into another location.

If you have any questions please feel free to post them in our computer help forums.

Users who read this also read:

How to use the Windows Snipping Tool

The Snipping Tool is a program that is part of Windows Vista, Windows 7, and Window 8. Snipping Tool allows you to take selections of your windows or desktop and save them as snips, or screen shots, on your computer. In the past if you wanted a full featured screen shot program you needed to spend some money to purchase a commercial one. If you needed basic screen shot capability, past versions of .

How to take and share a screen shot in Windows

Windows gives you the ability to take a snapshot of what is shown on your computer screen and save it as a file. You can then view this image at a later date to see what your screen looked like or share this image with other people to view. You may be asking why this is important and why you would want to share screen shots of your computer.

How to start Windows in Safe Mode

Windows Safe Mode is a way of booting up your Windows operating system in order to run administrative and diagnostic tasks on your installation. When you boot into Safe Mode the operating system only loads the bare minimum of software that is required for the operating system to work. This mode of operating is designed to let you troubleshoot and run diagnostics on your computer. Windows Safe Mode .

How to determine what services are running under a SVCHOST.EXE process

A very common question we see here at Bleeping Computer involves people concerned that there are too many SVCHOST.EXE processes running on their computer. The confusion typically stems from a lack of knowledge about SVCHOST.EXE, its purpose, and Windows services in general. This tutorial will clear up this confusion and provide information as to what these processes are and how to find out more .

Introduction to the Windows Command Prompt

Before Windows was created, the most common operating system that ran on IBM PC compatibles was DOS. DOS stands for Disk Operating System and was what you would use if you had started your computer much like you do today with Windows. The difference was that DOS was not a graphical operating system but rather purely textual. That meant in order to run programs or manipulate the operating system .

Оцените статью