Unable to fill a bookmark in libreoffice Writer

Hi, I have libreoffice 5.3 and I am programming in PowerBuilder 10.5. The problem is that It not recognize the getByName ("") with which I try to access the bookmarker in Writer. Has anyone succeeded? I guess the writer’s version is indifferent.

-The error he gives is: Name not found calling external object funtion getbyname.

-The code I use is the following:

li_ret=iole_serviceManager.ConnecttoNewObject(“com.sun.star.ServiceManager”)

iole_objDeskTop = iole_serviceManager.createInstance(“com.sun.star.frame.Desktop”)

iole_objDocumento = iole_objDeskTop.loadComponentFromURL(“file:///” + as_ruta, ‘_blank’, 0, iole_propertyValue[])

obookmark = iole_objDocumento.Bookmarks.getByNamex(“MARCADOR1”)

Does anyone have any idea that where I may be failing? Thank you very much in advance for your time reading me.

The code says getByNamex, but the error message says getbyname. Are you sure this error comes from this code?

Yes sorry, that was a try I made before post here. The original code is getByName. After debuging I’m sure the error come from that line. Thanks for your answer.

Solved:

string elementName[]
elementName = iole_objDocumento.Bookmarks.getElementNames()