2.2.4.46.21 Worksheet::EmbedNote

Description

Attaches a Note to Worksheet cell

Syntax

BOOL EmbedNote( int nRow, int nCol, Note & note, DWORD dwEmbedInfo = 0 )

Parameters

nRow
[input] row index of the cell where the note needs to be attached
nCol
[input] column index of the cell where the note needs to be attached
note
[input] Note object that will be embedded into the cell.
dwEmbedInfo
[input] can be one or more of the following:
EMBEDGRAPH_IN_LABELS = 0x00000020, // Embeds the Note in Label
EMBEDGRAPH_DO_UNDO = 0x00000040, // Allows undo of the attachment

Return

returns TRUE if successful

Examples

EX1

//Attach a note to worksheet cell.
void Worksheet_EmbedNote_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    
    Note npg;
    npg.Create();
    npg.Text = "Embed note";
    wks.EmbedNote(0, 0, npg);
}

EX2

//Add a note as a new sheet of Book1
void Worksheet_EmbedNote_Ex2()
{
    WorksheetPage wp("Book1");
    if(!wp)
    	return;
    
    int index = wp.AddLayer(); 
    Worksheet wks = wp.Layers(index);
    if(!wks)
        return;
 
    Note npg;
    npg.Create();
    npg.Text = "Embed note";
    
    wks.SetAsHolderSheet();
    wks.EmbedNote(0, 0, npg, EMBEDGRAPH_DO_UNDO);
}

Remark

See Also

Worksheet::EmbeddedPages, Worksheet::EmbedGraph, Worksheet::EmbedMatrix
Worksheet::SetAsHolderSheet

Header to Include

origin.h