Hi Laurent,
Message de Laurent Godard  date 2007-10-30 14:37 :
A user accesses OOo from VisualFoxPro through COM
It works
but, he can't access to nammed contants like
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK

What is the best way to use them ?


Despite efforts I could not find a way to find from COM the value of API
named constants.

In comparison, the value of an enum can be accessed from its name using
CoreReflection. However this uses some CPU-time at runtime.

In practice enum and constant values do not change with newer OpenOffice
versions (for backward compatibility). So you may simply create local
constants in your program.
One line of Basic code can help find the value of a particular enum or constant, example:
  MsgBox com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK

With the SDK and a relatively simple Basic program you can create a module or unit containing declarations of all the API constants/enums. For VB languages, have a look at the document ConstEnumsVB_en.odt contained in the 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