Bookmark.PasteAndFormat-Methode

Fügt die ausgewählten Tabellenzellen in das Bookmark-Steuerelement ein und formatiert sie wie angegeben.

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
)

Parameter

Hinweise

Durch Aufrufen dieser Methode wird möglicherweise das Bookmark-Steuerelement gelöscht.

Beispiele

Im folgenden Codebeispiel wird ein Microsoft Excel-Diagramm in das Bookmark-Steuerelement eingefügt. Für dieses Beispiel ist es erforderlich, dass die Zwischenablage ein Excel-Diagramm enthält.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

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-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace