NotesUIElement.getCurrentElement() returns null

Hi,

I’m trying to return the current open document in notes 8.5.2 (Notes Client Java UI APIs - v8.5.2.) using the following java code:

NotesUIWorkspace ws = new NotesUIWorkspace();

NotesUIElement element = ws.getCurrentElement();

If I start notes and create new email from new mail button on ‘Home’ page, element returns null.

If I open a mail replica and create a new email from there, element returns ok.

Any idea why element could return null when starting a new mail from the ‘Home’ page? Is there a way to fix this?

Thanks

Kevin