Bookmark.PasteExcelTable Method (Boolean, Boolean, Boolean)


Pastes and formats a Microsoft Office Excel table into the Bookmark control.

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

void PasteExcelTable(
	bool LinkedToExcel,
	bool WordFormatting,
	bool RTF


Type: System.Boolean

true to link the pasted table to the original Excel file so that changes made to the Excel file are reflected in Microsoft Office Word.

Type: System.Boolean

true to format the table using the formatting in the Word document. false to format the table according to the original Excel file.

Type: System.Boolean

true to paste the Excel table using Rich Text Format (RTF). false to paste the Excel table as HTML.

Calling this method might delete the Bookmark control.

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example pastes an Excel table into the Bookmark control. The parameters specify that the pasted table is linked to the Excel file, retains the original Excel formatting, and is pasted as RTF. This example requires that the Clipboard contains an Excel table.

This example is for a document-level customization.

private void BookmarkPasteExcelTable()
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =

    bool LinkedToExcel = true;
    bool WordFormatting = false;
    bool RTF = true;

    bookmark1.PasteExcelTable(LinkedToExcel, WordFormatting, RTF);
Return to top