GetOutlineEntry functions returns nothing

Hi,

I’m creating NotesOutlineEntries dynamically with Lotus Script.

I make one parent entry, and then I want to make several entries under this parent.

I call a function that checks whether the parent entry exists, if it does, the function gets the entry (so that I have the NotesOutlineEntry object) and makes a child entry under it.

However, I encounter a strange thing: At the moment that my function exits, I see my (parent) NotesOutlineEntry object. But when it returns to my Sub, it has nothing in it.

Can somebody tell me what’s going on here? Thx!

A part of the calling sub:

Dim parentEnt As NotesOutlineEntry

Dim rootEntName As String

Set parentEnt = getOutEntry(rootEntName, sOutlinename) → here parentEnt becomes nothing

Set outEnt = out.CreateEntry(entryName, parentEnt, True, True)

Function getOutEntry(sEntryname As String, sOutlinename As String) As NotesOutlineEntry

Dim out As NotesOutline

Dim outEnt As NotesOutlineEntry



On Error Goto ErrorHandler



Set out = db.GetOutline(sOutlinename )	

Set outEnt = out.GetFirst



While Not outEnt Is Nothing

	If outEnt.Label = sEntryname Then

		Set getOutEntry = outEnt

		Exit Function			--> here getOutEntry has a value

	End If

	Set outEnt = out.GetNext(outEnt)

Wend

Exit Function