[Previous] [Contents] [Next]

Create a "Paste as Unformatted Text" Macro


The Problem:

I often have to create documents that are cobbled together from various sources, and I need to strip out all the existing formatting.

The Solution:

Pasting material as unformatted text can save you plenty of formatting annoyances. To automate the process, all you need is a single line of VBA code (see Example 8-6).

Example 8-6. A macro that pastes as unformatted text
Sub Paste_As_Unformatted_Text()
    Selection.PasteSpecial Link:=False, DataType:=wdPasteText, _
        Placement:=wdInLine, DisplayAsIcon:=False
End Sub


[Previous] [Contents] [Next]