openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard Marcelly <marce...@club-internet.fr>
Subject Re: Is the view-cursor in the table of contents?
Date Tue, 28 Jul 2015 16:59:16 GMT
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.

Reminder: a Table of Contents is a particular type of document index.


Regards
   Bernard


Jörg Schmidt a écrit le 2015-07-28 08:56 :
> Hello,
>
> in a text document is my view-cursor:
>
> v_cur = ThisComponent.CurrentController.ViewCursor
>
>
> How can I reliably(!) test whether this view-cursor currently located in the table of
contents?
>
>
> note:
> Ok, I can, for example, check:
>
> Msgbox v_cur.Textsection.LinkDisplayName
>
> but I think this is not reliable because ".LinkDisplayName" is just a name that can be
changed.
>
>
>
> Greetings,
> Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: api-help@openoffice.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org


Mime
View raw message