Message de Sandeep Raghuvanshi  date 2007-09-20 16:58 :
Hi,
I am trying to implement the hyperlink functionality for table of content
using Visual Basic 6.0 and though the documentation says that we have to
pass first parameter as Long and Second one as Any/Variant, the
replaceByIndex is always throwing IllegalArgumentException.

Here is the code:

( ... )


       Call oTOC.LevelFormat.replaceByIndex(iIndexLevel, newFormat)


I already have answered a similar question in
<http://www.oooforum.org/forum/viewtopic.phtml?p=239563#239563>

Answer adapted to your case:

You have to pass an array of Uno objects, and the argument of replaceByIndex is defined as : any
So you have to tell the bridge what exactly you are passing.
This is a limitation of the COM bridge, whatever the language you use.

Solution:
Dim unoWrap As Variant
Set unoWrap = oSM.Bridge_GetValueObject
unoWrap.set "[]com.sun.star.beans.PropertyValue", newFormat
Call oTOC.LevelFormat.replaceByIndex(iIndexLevel, unoWrap)


Concerning OOo general programming through VB6 you may be interested in the libraries provided by VBx_OOo tool : <http://www.ooomacros.org/dev.php#240562>

______
Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to