I am going to make 2 assumptions in the following code.
a) You are runnning a notes environment > 5.02
b) By “in the client” I am assuming that you mean a Lotus Notes Client.
‘This code assumes the mail database is open
‘And that this agent is called from the Action bar or Menu
Dim s As New NotesSession
Dim db As NotesDatabase
Dim ol As NotesOutline
Dim olEnt As NotesOutlineEntry
Set db = s.CurrentDatabase
‘Gets the outline called NotesMailOutline in your Mail Database
Set ol = db.GetOutline(“NotesMailOutline”)
‘Gets the current UI Session and requests the new outline entry name from the user
Dim ws As New NotesUIWorkspace
Dim askme As String
askme = ws.Prompt(PROMPT_OKCANCELEDIT, _
“Outline Entry Name”, _
“Please enter the Name for the new entry here.”)
‘Creates a new outline entry titled with the response from the askme prompt
‘and adds it to the outline
Set olEnt = ol.CreateEntry(askme)
‘Saves the outline with its new entry
‘Most important part – refresh the CLIENT! NOT the DOC
Call ws.ReloadWindow( )
This agent uses a combination of Front and Back – End classes to create the required outline entry and then update the client in the front end (ws).
Hope this helps!