Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 1.29 KB

Word.Selection.PasteFormat.md

File metadata and controls

65 lines (40 loc) · 1.29 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Selection.PasteFormat method (Word)
vbawd10.chm158663166
vbawd10.chm158663166
Word.Selection.PasteFormat
5c8a69fa-4d07-619c-950a-5ff11fa99003
06/08/2017
medium

Selection.PasteFormat method (Word)

Applies formatting copied with the CopyFormat method to the selection.

Syntax

expression. PasteFormat

expression Required. A variable that represents a Selection object.

Remarks

If a paragraph mark was selected when the CopyFormat method was used, Word applies paragraph formatting in addition to character formatting.

Example

This example copies the paragraph and character formatting from the first paragraph in the selection to the next paragraph in the selection.

With Selection 
 .Paragraphs(1).Range.Select 
 .CopyFormat 
 .Paragraphs(1).Next.Range.Select 
 .PasteFormat 
End With

This example collapses the selection and copies the character formatting to the next word.

With Selection 
 .Collapse Direction:=wdCollapseStart 
 .CopyFormat 
 .Next(Unit:=wdWord, Count:=1).Select 
 .PasteFormat 
End With

See also

Selection Object

[!includeSupport and feedback]