WD2002: Pasted Text Keeps Source Formatting by Default (283388)
The information in this article applies to:
This article was previously published under Q283388 SYMPTOMS
When you paste text, the text is pasted with the formatting of the copied text. In order for the pasted text to acquire the formatting of the destination text, you must select Match Destination Formatting each time that you paste.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To automatically paste the text to match the formatting of the destination text, create the following sample macro, and assign the macro to a shortcut key. Use the shortcut key to paste the copied text into an existing document.
To create the macro, follow these steps:
- On the Tools menu, point to Macro, and then click Macros.
- In the Macros dialog box, type PasteAsDestinationFormat and then click Create.
- Create the following sample macro:
Sub PasteAsDestinationFormat()
Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
End Sub
- On the File menu, click Close and Return to Microsoft Word.
To assign a shortcut key to your macro, follow these steps:
- On the Tools menu, click Customize.
- Click Keyboard.
- Under Categories, click to select Macros.
- Under Macros, click to select PasteAsDestinationFormat.
- In the Press new shortcut key box, type the shortcut keys that you want to assign to the macro. For example, press CTRL+F.
- Click Assign.
- Click Close to close the Customize Keyboard dialog box.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbmacroexample kbprb KB283388 |
---|
|