> From: Bernard Marcelly [mailto:[email protected]] > Sent: Tuesday, July 28, 2015 6:59 PM > To: [email protected] > 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: [email protected] For additional commands, e-mail: [email protected]
