> From: Bernard Marcelly [mailto:marce...@club-internet.fr] > Sent: Tuesday, July 28, 2015 6:59 PM > To: api@openoffice.apache.org > Subject: Re: Is the view-cursor in the table of contents? > > Hi Jörg, > > Dim v_cur As Object, dix As Object > > v_cur = ThisComponent.CurrentController.ViewCursor > dix = nothing > On Error Resume Next > dix = v_cur.DocumentIndex > On Error GoTo 0 > if IsNull(dix) then > MsgBox("Not in an index") > else > MsgBox("Index, service : " & dix.ServiceName) > end if > > The error handling is necessary because outside of an index, property > DocumentIndex does not exist.
Thank you, works just fine. Greetings, Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org