Setting Text to New Note (INoteDataUtils)
Hi,
I'm trying to create a new note in a text object. The note gets created successfully, and I'm also able to set the author without any issue.
However, when I try to create or access the ITextModel to set the text content of the note, it returns nil. I'm not sure what I'm missing here.
Any help or suggestions would be greatly appreciated.
Thanks!
UIDRef storyRef = ::GetUIDRef(textModel);
UIDRef newNoteRef = Utils<INoteDataUtils>()->NewNote(start,storyRef,documentRef);
if(newNoteRef)
{
InterfacePtr<INoteData> noteData(newNoteRef, UseDefaultIID());
ASSERT(noteData);
if(noteData == nil) {
break;
}
PMString AuthorName = "Chetan";
WideString author(AuthorName);
noteData->SetAuthor(author);
InterfacePtr<ITextModel> noteTextModel(newNoteRef, IID_ITEXTMODEL);
