Worksheet::PasteData

Description

Paste specified, tab-delimited text into a worksheet

Syntax

BOOL PasteData( LPCTSTR lpcszText, int nRow = -1, int nCol = 0, int nRepaintMode = 0 )

Parameters

lpcszText
[input] Tab delimited data values
nRow
[input] Optional row number to begin the paste. Less than 0 means to append from the
first unfilled row of the worksheet. Its default value is -1.
nCol
[input] Optional column number to begin the paste. Less than 0 to append from the
first unfilled column ( not supported yet). Its default value is 0.
nRepaintMode
[input] Window Refresh mode. Default will use realtime drawing, can disable repaint, or direct repaint.

Return

TRUE for success, otherwise FALSE

Examples

EX1

//Paste specified, tab-delimited text into a worksheet. 
int Worksheet_PasteData_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return -1;
    
    Worksheet wks(wp.GetName());
    string str = "1\t2\t3\r\n4\t5\t6";
    //append from the first unfilled row of the worksheet.
    wks.PasteData(str);
    return wks.GetNumRows();
}

Remark

This member function is similar to paste text from clipboard into the worksheet

The data is tab delimited

See Also

header to Include

origin.h