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 4 5Sub StartDicOOo 6 7Dim ThePath as string 8Dim DefPath as string 9Dim aService as object 10Dim MyDicOOo as string 11dim TheDoc as object 12dim args(1) as new com.sun.star.beans.PropertyValue 13 14on error resume next 15 16' Find path 17aService = CreateUnoService("com.sun.star.util.PathSubstitution") 18ThePath =ConvertToURL(aService.substituteVariables("$(user)", true)) 19ThePath=ThePath & "/wordbook" 20DefPath =ConvertToURL(aService.substituteVariables("$(prog)", true)) 21DefPath=DefPath & "/../share/dict/ooo" 22 23MyDicOOo="" 24 25if 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 29 close #1 30else 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 35 close #1 36 else 37 'creates default file in user directory 38 Open ThePath & "/DicOOo.lst" for output as #1 39 print #1,convertFromURL(DefPath & "/DicOOo.sxw") 40 close #1 41 endif 42endif 43 44'security 45if Not fileExists(MyDicOOo) then 46 MyDicOOo= DefPath & "/DicOOo.sxw" 47endif 48 49MyDicOOo=ConvertToURL(MyDicOOo) 50 51'Opens DicOOo main file 52args(0).name="InteractionHandler" 53args(0).value="" 54args(1).name="MacroExecutionMode" 55args(1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN '4 56TheDoc=StarDesktop.loadComponentFromURL(MyDicOOo,"_blank",0,args()) 57 58End Sub 59</script:module> 60