home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2004 April / VPR0404.ISO / OPENOFFICE / INSTALL / f_0304 / DicOOo.xba < prev    next >
Extensible Markup Language  |  2004-01-13  |  2KB  |  47 lines

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