Ask Your Question
0

Unable to fill a bookmark in libreoffice Writer

asked 2017-11-23 14:51:07 +0200

tucutu gravatar image

Hi, I have libreoffice 5.3 and I am programming in PowerBuilder 10.5. The problem is that It not recognize the getByName ("<marker>") 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.

edit retag flag offensive close merge delete

Comments

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

Jim K gravatar imageJim K ( 2017-11-23 16:53:46 +0200 )edit

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.

tucutu gravatar imagetucutu ( 2017-11-24 08:23:58 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-11-24 12:30:03 +0200

tucutu gravatar image

Solved:

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-11-23 14:51:07 +0200

Seen: 43 times

Last updated: Nov 24 '17