1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"DicOOo" script:
language=
"StarBasic">Option Explicit
10 Dim MyDicOOo as string
12 dim args(
1) as new com.sun.star.beans.PropertyValue
17 aService = CreateUnoService(
"com.sun.star.util.PathSubstitution
")
18 ThePath =ConvertToURL(aService.substituteVariables(
"$(user)
", true))
19 ThePath=ThePath
& "/wordbook
"
20 DefPath =ConvertToURL(aService.substituteVariables(
"$(prog)
", true))
21 DefPath=DefPath
& "/../share/dict/ooo
"
25 if fileExists(ThePath
& "/DicOOo.lst
") then
26 'read DicOOo.lst file in user directory
27 Open ThePath
& "/DicOOo.lst
" for input as #
1
28 line input #
1, MyDicOOo
31 if fileExists(DefPath
& "/DicOOo.lst
") then
32 'read DicOOo.lst file in share directory
33 Open DefPath
& "/DicOOo.lst
" for input as #
1
34 line input #
1, MyDicOOo
37 'creates default file in user directory
38 Open ThePath
& "/DicOOo.lst
" for output as #
1
39 print #
1,convertFromURL(DefPath
& "/DicOOo.sxw
")
45 if Not fileExists(MyDicOOo) then
46 MyDicOOo= DefPath
& "/DicOOo.sxw
"
49 MyDicOOo=ConvertToURL(MyDicOOo)
51 'Opens DicOOo main file
52 args(
0).name=
"InteractionHandler
"
53 args(
0).value=
""
54 args(
1).name=
"MacroExecutionMode
"
55 args(
1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
'4
56 TheDoc=StarDesktop.loadComponentFromURL(MyDicOOo,
"_blank
",
0,args())