Hello Laurent!
I started to write a macro to open Documentiation from help menu. I am
currently stay here:
REM ***** BASIC *****
Sub Main
OpenHelpDocument
End Sub
Function OOoLangue() as string
'Author : Laurent Godard
'e-mail : [EMAIL PROTECTED]
Dim oSet, oConfigProvider
Dim oParm(0) As New com.sun.star.beans.PropertyValue
Dim sProvider$, sAccess$
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
oConfigProvider = createUnoService(sProvider)
oParm(0).Name = "nodepath"
oParm(0).Value = "/org.openoffice.Setup/L10N"
oSet = oConfigProvider.createInstanceWithArguments(sAccess, oParm())
Dim OOLangue as string
OOLangue= oSet.getbyname("ooLocale") 'en-US
End Function
Sub OpenHelpDocument
REM Variables
Dim mArgs(2) as New com.sun.star.beans.PropertyValue
Dim oDoc
Dim oFrame
Dim s As String
REM Location of Help Document
s = "file:///C|/Program Files/OpenOffice.org%202.0/share/samples/" &
OOoLangue( ) & "/Documentations/ooo2agy.odt"
REM PROBLEM!!!
Print s
REM c:\Program Files\OpenOffice.org 2.0\share\samples\hu\Documentations\
mArgs(0).Name = "ReadOnly"
mArgs(0).Value = True
mArgs(1).Name = "MacroExecutionMode"
mArgs(1).Value = 4
mArgs(2).Name = "AsTemplate"
mArgs(2).Value = FALSE
REM Open up, open up
oDoc = StarDesktop.LoadComponentFromUrl(s, "_blank", 2, mArgs())
REM Error handling
If IsNull(oDoc) OR IsEmpty(oDoc) Then
Print "Unable to load " & s
End If
End Sub
please check the string value REMMARKED with PROBLEM. I couln't get the
language of running OpenOffice.org... Why? What did I wrong? Also, how
can I get the folder of OpenOffice.org (C:/Program Files/OpenOffice.org
2.0, /opet/OpenOffice.org 2.0/) ? I need these variables to locates
samples folder...
Regards,
KAMI
Laurent Godard írta:
Hi Kami
Can you give me a hint how can I add an extra menu element to the
help menu. I would like to insert an menu element that opens a
document (read only mode) from all available OpenOffice.org
application. This is because I want to show the OpenOffice.org
Guide. Where can I read more infos about this? How can I do it? Has
someone a workin code snippet?
Thanks
KAMI
Anyone has idea how to do it?
you may have a look at OooWikipedia Addon
it implements what you want
http://www.indesko.com/sites/en/downloads/ooowikipedia/view
look at the code for the help and the addon.xcu file
HTH
Laurent
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]