Bookmark.PasteAndFormat(WdRecoveryType) Method

Definition

Pastes the selected table cells into the Bookmark control and formats them as specified.

public:
 void PasteAndFormat(Microsoft::Office::Interop::Word::WdRecoveryType Type);
public void PasteAndFormat (Microsoft.Office.Interop.Word.WdRecoveryType Type);
abstract member PasteAndFormat : Microsoft.Office.Interop.Word.WdRecoveryType -> unit
Public Sub PasteAndFormat (Type As WdRecoveryType)

Parameters

Type
WdRecoveryType

WdRecoveryType. The type of formatting to use when pasting the selected table cells.

Examples

The following code example pastes a Microsoft Excel chart into the Bookmark control. This example requires that the Clipboard contains an Excel chart.

This example is for a document-level customization.

private void BookmarkPasteAndFormat()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    
    bookmark1.PasteAndFormat(Word.WdRecoveryType.wdFormatOriginalFormatting);
}
Private Sub BookmarkPasteAndFormat()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.PasteAndFormat(Word.WdRecoveryType _
        .wdFormatOriginalFormatting)

End Sub

Remarks

Calling this method might delete the Bookmark control.

Applies to