Line 0
Link Here
|
|
|
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 |
4 |
|
5 |
Sub StartFontOOo |
6 |
|
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 |
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 & "/FontOOo.lst") then |
21 |
'read FontOOo.lst file |
22 |
Open ThePath & "/FontOOo.lst" for input as #1 |
23 |
line input #1, MyFontOOo |
24 |
close #1 |
25 |
else |
26 |
'create default FontOOo.lst file |
27 |
Open ThePath & "/FontOOo.lst" for output as #1 |
28 |
MyFontOOo=ThePath & "/FontOOo.sxw" |
29 |
print #1, MyFontOOo |
30 |
close #1 |
31 |
endif |
32 |
|
33 |
'security |
34 |
if Not fileExists(MyFontOOo) then |
35 |
MyFontOOo= ThePath & "/FontOOo.sxw" |
36 |
endif |
37 |
MyFontOOo=ConvertToURL(MyFontOOo) |
38 |
|
39 |
'Opens FontOOo 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(MyFontOOo,"_blank",0,args()) |
45 |
|
46 |
End Sub</script:module> |