Share via


Bookmark.PasteAndFormat Method

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Sub PasteAndFormat ( _
    Type As WdRecoveryType _
)
void PasteAndFormat(
    WdRecoveryType Type
)

Parameters

Remarks

Calling this method might delete the Bookmark control.

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 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
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);
}

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace