update dev300-m58
[ooovba.git] / wizards / source / launcher / FontOOo.xba
blobc05e0c11bb2ca460accb220e06ed591f7872fb7b
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="FontOOo" script:language="StarBasic">Option Explicit
5 Sub StartFontOOo
7 Dim ThePath as string
8 Dim aService as object
9 Dim MyFontOOo as string
10 dim TheDoc as object
11 dim args(1) as new com.sun.star.beans.PropertyValue
13 on error resume next
15 &apos; Find path
16 aService = CreateUnoService(&quot;com.sun.star.util.PathSubstitution&quot;)
17 ThePath =ConvertToURL(aService.substituteVariables(&quot;$(prog)&quot;, true))
18 ThePath=ThePath &amp; &quot;/../share/dict/ooo&quot;
20 if fileExists(ThePath &amp; &quot;/FontOOo.lst&quot;) then
21 &apos;read FontOOo.lst file
22 Open ThePath &amp; &quot;/FontOOo.lst&quot; for input as #1
23 line input #1, MyFontOOo
24 close #1
25 else
26 &apos;create default FontOOo.lst file
27 Open ThePath &amp; &quot;/FontOOo.lst&quot; for output as #1
28 MyFontOOo=ThePath &amp; &quot;/FontOOo.sxw&quot;
29 print #1, MyFontOOo
30 close #1
31 endif
33 &apos;security
34 if Not fileExists(MyFontOOo) then
35 MyFontOOo= ThePath &amp; &quot;/FontOOo.sxw&quot;
36 endif
37 MyFontOOo=ConvertToURL(MyFontOOo)
39 &apos;Opens FontOOo main file
40 args(0).name=&quot;InteractionHandler&quot;
41 args(0).value=&quot;&quot;
42 args(1).name=&quot;MacroExecutionMode&quot;
43 args(1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN &apos;4
44 TheDoc=StarDesktop.loadComponentFromURL(MyFontOOo,&quot;_blank&quot;,0,args())
46 End Sub</script:module>