summaryrefslogtreecommitdiff
path: root/testautomation/writer/tools/includes/w_tools.inc
blob: b1d00fae739362a812cc5368c6c1786c9173322e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
'encoding UTF-8  Do not remove or change this line!
'*******************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'*
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
'*
'* $RCSfile: w_tools.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: vg $ $Date: 2008-08-18 12:44:20 $
'*
'* This file is part of OpenOffice.org.
'*
'* OpenOffice.org is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License version 3
'* only, as published by the Free Software Foundation.
'*
'* OpenOffice.org is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU Lesser General Public License version 3 for more details
'* (a copy is included in the LICENSE file that accompanied this code).
'*
'* You should have received a copy of the GNU Lesser General Public License
'* version 3 along with OpenOffice.org.  If not, see
'* <http://www.openoffice.org/license.html>
'* for a copy of the LGPLv3 License.
'*
'/******************************************************************************
'*
'* owner : helge.delfs@sun.com
'*
'* short description : Writer-Tools
'*
'\******************************************************************************

sub wDokSchreiben ( OutputText , optional iLoop as Integer )
    Dim i as integer
    If lcase(OutputText) = "<mod1 a>" then
        If iSprache = 34 then OutputText = "<Mod1 E>"
    end if
    If IsMissing(iLoop) = True then iLoop = 1
    For i = 1 to iLoop
        Select Case Ucase(gApplication)
        Case "WRITER"
            Kontext "DocumentWriter"
            DocumentWriter.TypeKeys OutputText

        Case "MASTERDOCUMENT"
            Kontext "DocumentMasterDoc"
            DocumentMasterDoc.TypeKeys OutputText

        Case "HTML"
            Kontext "DocumentWriterWeb"
            DocumentWriterWeb.TypeKeys OutputText

        case "DRAW"
            Call hTextrahmenErstellen (OutputText,35,35,50,20)
        case "IMPRESS"
            Call hTextrahmenErstellen (OutputText,35,35,50,20)

        end select
        wait 500
    next i
end sub

' -----------------------------------------------------------------------

sub wTypeKeys ( OutputText , optional iLoop as Integer )
    Dim i as integer
    If lcase(OutputText) = "<mod1 a>" then
        If iSprache = 34 then OutputText = "<Mod1 E>"
    end if
    If IsMissing(iLoop) = True then iLoop = 1
    For i = 1 to iLoop
        Select Case Ucase(gApplication)
        Case "WRITER"
            Kontext "DocumentWriter"
            DocumentWriter.TypeKeys OutputText

        Case "MASTERDOCUMENT"
            Kontext "DocumentMasterDoc"
            DocumentMasterDoc.TypeKeys OutputText

        Case "HTML"
            Kontext "DocumentWriterWeb"
            DocumentWriterWeb.TypeKeys OutputText

        case "DRAW"
            Call hTextrahmenErstellen (OutputText,35,35,50,20)
        case "IMPRESS"
            Call hTextrahmenErstellen (OutputText,35,35,50,20)
        end select
        wait 500
    next i
end sub

' -----------------------------------------------------------------------

sub wDocSetContext
    Select Case Ucase(gApplication)
    Case "WRITER"
        Kontext "DocumentWriter"

    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"

    Case "HTML"
        Kontext "DocumentWriterWeb"

    Case "IMPRESS"
        Kontext "DocumentImpress"

    Case "DRAW"
        Kontext "DocumentDraw"

    Case "MATH"
        Kontext "DocumentMath"

    Case "CALC"
        Kontext "DocumentCalc"

    end select
    wait 500
end sub

' -----------------------------------------------------------------------

function wBlindtextEinfuegen() as boolean
    '/// This functions inserts a Dummytext and returns true if it was inserted
    Dim BlindText as string, bTemp as boolean
    bTemp = False
    select case iSprache
    case 01    : BlindText = "DT<F3>"
    case 03    : BlindText = "TE<F3>"
    case 07    : BlindText = "DT<F3>"
    case 31    : BlindText = "BT<F3>"
    case 34    : BlindText = "TE<F3>"
    case 33    : BlindText = "TEX<F3>"
    case 39    : BlindText = "TE<F3>"
    case 45    : BlindText = "ET<F3>"
    case 46    : BlindText = "BT<F3>"
    case 48    : BlindText = "TW<F3>"
    case 49    : BlindText = "BT<F3>"
    case 55    : BlindText = "TP<F3>"
    case 81    : BlindText = "DT<F3>"
    case 82    : BlindText = "BT<F3>"
    case 86    : BlindText = "DT<F3>"
    case 88    : BlindText = "BT<F3>"
    case else : QAErrorlog "No Shortcut for Dummytext available!"
    end select

    if BlindText > "" then
        Call wTypeKeys BlindText
        Kontext "Active"
        if Active.Exists then
            if Active.GetRT = 304 then
                Warnlog Active.Gettext
                Active.Ok
            else
                bTemp = True
            end if
        else
            bTemp = True
        end if
    end if

    wBlindtextEinfuegen = bTemp

end function

' -----------------------------------------------------------------------

sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optional sCloseToolbar as boolean )

    Kontext "DrawBar"
    if Not DrawBar.Exists then Call hToolbarSelect("Drawing", true)
    Sleep 2

    Objekt = UCase( Objekt )
    select case Objekt
    case "RECHTECK" : Rechteck.Click
    case "LINIE"     : Linie.Click
    case "ELLIPSE"  : Ellipse.Click
    case "TEXT"      : Textobjekt.Click
    case "VTEXT"     :
        try
            VerticalText.Click
        catch
            if gAsianSup = True then
                Warnlog "Unable to insert Vertical Text! Asian Support in Options activated ?"
            end if
        endcatch
    case "LAUFTEXT" : Lauftext.Click
    case "LEGENDE"  : Legende.Click
    case "VLEGENDE" :
        try
            VerticalCallout.Click
        catch
            Warnlog "Unable to insert Vertical Callout! Asian Support in Options activated ?"
        endcatch
    end select

    Select Case gApplication
    Case "WRITER"
        Kontext "DocumentWriter"
        DocumentWriter.MouseDown xStart%, yStart%
        DocumentWriter.MouseMove xEnde%, yEnde%
        DocumentWriter.MouseUp xEnde%, yEnde%
        wait 100
        Kontext "Drawbar"
        if IsMissing(sCloseToolbar) then
            Drawbar.Close
        else
            if sCloseToolbar = true then Drawbar.Close
        end if
        if Objekt <> "TEXT" and Objekt <> "VTEXT" then
            Kontext "DocumentWriter"
            Call gMouseClick (1, 1)
            wait 100
        end if

    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"
        DocumentMasterDoc.MouseDown xStart%, yStart%
        DocumentMasterDoc.MouseMove xEnde%, yEnde%
        DocumentMasterDoc.MouseUp xEnde%, yEnde%
        wait 100
        Kontext "Drawbar"
        if IsMissing(sCloseToolbar) then
            Drawbar.Close
        else
            if sCloseToolbar = true then Drawbar.Close
        end if
        if Objekt <> "TEXT" and Objekt <> "VTEXT" then
            Kontext "DocumentMasterDoc"
            Call gMouseClick (1, 1)
            wait 100
        end if
    end select
end sub

' -----------------------------------------------------------------------

sub wObjektSelektieren ( xStart%, yStart%, xEnde%, yEnde% )
    '    Call gMouseClick(90,90)
    Call hToolbarSelect("DRAWING",true)
    Auswahl.Click
    Select Case gApplication
    Case "WRITER"
        Kontext "DocumentWriter"
        DocumentWriter.MouseDown xStart%, yStart%
        DocumentWriter.MouseMove xEnde%, yEnde%
        DocumentWriter.MouseUp xEnde%, yEnde%
    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"
        DocumentMasterDoc.MouseDown xStart%, yStart%
        DocumentMasterDoc.MouseMove xEnde%, yEnde%
        DocumentMasterDoc.MouseUp xEnde%, yEnde%
    end select
    wait 200
end sub

' -----------------------------------------------------------------------

sub wFindSelectObjectBelow ( xStart%, yStart%, xEnde%, yEnde% )
    WL_TB_ZF_Auswahl
    Select Case gApplication
    Case "WRITER"
        Kontext "DocumentWriter"
        DocumentWriter.MouseMove xStart%, yStart%
        DocumentWriter.MouseDown xStart%, yStart%
        DocumentWriter.MouseUp xStart%, yStart%

        do while (Mousepointer<>"Normalpointer")
            DocumentWriter.MouseMove xEnde%, yEnde%
            DocumentWriter.MouseDown xEnde%, yEnde%
            DocumentWriter.MouseUp
        loop

        i = 1
        while ((getMouseStyle = 0) AND (i<80))
            sleep 1
            inc (i)
            printlog getMouseStyle
            if (getMouseStyle <> 0) then i = 80
        wend

    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"
        DocumentMasterDoc.MouseDown xStart%, yStart%
        DocumentMasterDoc.MouseMove xEnde%, yEnde%
        DocumentMasterDoc.MouseUp xEnde%, yEnde%
    end select
    wait 200
end sub

' -----------------------------------------------------------------------

function WortAusWoerterbuchLoeschen ( Aufnahme$ ) as Boolean
    Dim i as integer : Dim AnzahlBuecher as string
    Dim j as integer

    ToolsOptions
    Call hToolsOptions("LanguageSettings","WritingAids")
    WortAusWoerterbuchLoeschen = FALSE
    for j = 1 to Benutzerwoerterbuch.GetItemCount
        try
            Bearbeiten.Click
            exit for
        catch
            Benutzerwoerterbuch.Select j
        endcatch
    next j
    Kontext "BenutzerwoerterbuchBearbeiten"
    AnzahlBuecher = Buch.GetItemCount

    for i= 1 to AnzahlBuecher
        Buch.Select i
        printlog "      - search word in module: " + Buch.GetSelText
        Kontext "BenutzerwoerterbuchBearbeiten"
        Inhalt.SetText Aufnahme$
        Sleep 1
        if Entfernen.IsEnabled then
            Entfernen.Click
            WortAusWoerterbuchLoeschen = TRUE
            i = AnzahlBuecher + 1
        end if
    next i
    if WortAusWoerterbuchLoeschen = FALSE then Warnlog "The added word has not been found in modules"
    BenutzerwoerterbuchBearbeiten.Close
    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK
end function

' -----------------------------------------------------------------------

function wIgnorierenlisteLoeschen
    Dim i as integer : Dim j as integer : Dim AlleBuecher as integer

    ToolsOptions
    Call hToolsOptions("LANGUAGESETTINGS","WRITINGAIDS")
    Sleep 3
    for j = 1 to Benutzerwoerterbuch.GetItemCount
        try
            Bearbeiten.Click
            exit for
        catch
            Benutzerwoerterbuch.Select j
        endcatch
    next j
    Kontext "BenutzerwoerterbuchBearbeiten"
    sleep 1
    AlleBuecher = Buch.GetItemCount
    for i = 1 to AlleBuecher
        Buch.Select i
        if Left$(Buch.GetSelText,13)="IgnoreAllList" then
            sleep 2
            for j = 1 to 100
                if Loeschen.IsEnabled then
                    Loeschen.Click
                    sleep 1
                else
                    Kontext "Active"
                    if Active.Exists then
                        Warnlog Active.Gettext
                        Active.Ok
                    end if
                    Kontext "BenutzerwoerterbuchBearbeiten"
                    BenutzerwoerterbuchBearbeiten.Cancel
                    sleep 1
                    j=101
                end if
                wait 500
            next j
            i=AlleBuecher + 1
        end if
    next i
    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK
end function

' -----------------------------------------------------------------------

sub hLeisteUmschalten(welche as integer)
    Sleep 2
    Select Case welche
    case 1:
        try                                             ' Textobjectbar
            Kontext "NumObjectbar"
            NumObjectbar.SetNextToolbox
        catch
        endcatch
        Sleep 1
        if gApplication = "HTML" then
            Kontext "TextObjectbar"
        else
            Kontext "TextObjectbar"
        end if
        Sleep 1
        try
            Fett.Click    ' Sonst sind Comboboxen fȭr Testtool nicht sichtbar
            Sleep 1
            Fett.Click
        catch
            Warnlog "Error on switching the function bar!"
        endcatch
        Sleep 1

    case 2:
        Select Case gApplication
            ' Numbering-Objectbar
        Case "HTML"
            Kontext "TextObjectbar"
            try
                TextObjectbar.SetNextToolbox
            catch
            endcatch

        Case else
            Kontext "TextObjectbar"
            try
                TextObjectbar.SetNextToolbox
            catch
            endcatch
        end select
        Sleep 1
        Kontext "NumObjectbar"
        try
            Hinunterstufen.Click
        catch
            try
                Hochstufen.Click
            catch
                Warnlog "Error on switching the function bar!"
            endcatch
        endcatch
        Sleep 2
    end select
end sub

' -----------------------------------------------------------------------

sub hGrafikleisteUmschalten(welche as integer)
    Select Case welche
    case 1:
        try
            Kontext "GraphicObjectbar"
            Wait 500
            GraphicObjectbar.SetNextToolBox
        catch
        endcatch
        Kontext "FrameObjectbar"
        Sleep 1

    case 2:
        try
            Kontext "FrameObjectbar"
            Wait 500
            FrameObjectbar.SetNextToolBox
        catch
        endcatch
        Kontext "GraphicObjectbar"
        Sleep 1
    end select
end sub

' -----------------------------------------------------------------------

sub wEinfuegenHyperlink(welcheSeite as integer)
    Kontext "Hyperlink"
    Auswahl.MouseDown 2,2
    Auswahl.MouseUp 2,2
    wait 500
    Auswahl.TypeKeys "<Down>",1
    wait 500
    Auswahl.TypeKeys "<Up>",4
    Sleep 1

    Select case welcheSeite
    case 1:
        Kontext "TabHyperlinkInternet"

    case 2:
        Auswahl.TypeKeys "<Down>",1
        Kontext "TabHyperlinkMailUndNews"

    case 3:
        Auswahl.TypeKeys "<Down>",2
        Kontext "TabHyperlinkDokument"

    case 4:
        Auswahl.TypeKeys "<Down>",3
        Kontext "TabHyperlinkNeuesDokument"

    end select
end sub

' -----------------------------------------------------------------------

sub wNavigatorAuswahl(Gruppe as integer, Eintrag as integer,optional LeaveFocus as boolean)
    dim j as integer, WelcherEintrag as integer
    Dim MinEntrys as integer

    If IsMissing(LeaveFocus) = True then LeaveFocus = False

    Select Case Ucase(gApplication)
    Case "CALC"
        Kontext "NavigatorCalc"
        if NavigatorCalc.NotExists then ViewNavigator
        wait 500
        Kontext "NavigatorCalc"
        MinEntrys = 8
    Case "WRITER", "HTML", "HTML"
        Kontext "NavigatorWriter"
        if NavigatorWriter.NotExists then ViewNavigator
        wait 500
        Kontext "NavigatorWriter"
        MinEntrys = 11
    Case "MASTERDOCUMENT"
        Kontext "NavigatorGlobalDoc"
        if NavigatorGlobalDoc.NotExists then ViewNavigator
        wait 500
        Kontext "NavigatorGlobalDoc"
        if Liste.IsVisible then
            Kontext "GlobaldokumentToolbox"
            Umschalten.Click
            Kontext "NavigatorWriter"
        end if
        MinEntrys = 11
    Case Else ' for all others!!!!
        Warnlog "Not supported application!"
        exit sub
    end select

    Sleep 2

    Select Case Ucase(gApplication)
    Case "CALC"
        if (Liste.GetItemCount < MinEntrys) then Umschalten.Click
        if Liste.GetItemCount >MinEntrys then
            For j= 1 to 9
                Liste.Select j
                Liste.TypeKeys "-"
            next j
        end if

        Liste.Select Gruppe
        if Eintrag >0 then
            WelcherEintrag = Gruppe + Eintrag
            Liste.TypeKeys "+"
            Liste.Select WelcherEintrag
            Liste.TypeKeys "<Return>"
        end if

    Case "WRITER","HTML", "HTML"
        if (Auswahlliste.GetItemCount < MinEntrys) then
            try
                Inhaltsansicht.Click
            catch
            endcatch
        end if
        if Auswahlliste.GetItemCount >MinEntrys then
            For j= 1 to 12
                Auswahlliste.Select j
                Auswahlliste.TypeKeys "-"
            next j
        end if

        Auswahlliste.Select Gruppe
        if Eintrag >0 then
            WelcherEintrag = Gruppe + Eintrag
            Auswahlliste.TypeKeys "+"
            Auswahlliste.Select WelcherEintrag
            Auswahlliste.TypeKeys "<Return>"
        end if

    Case "MASTERDOCUMENT"
        if Liste.IsVisible = True then
            Umschalten.Click
        end if

        if Auswahlliste.GetItemCount >MinEntrys then
            For j= 1 to 12
                Auswahlliste.Select j
                Auswahlliste.TypeKeys "-"
            next j
        end if

        Auswahlliste.Select Gruppe
        if Eintrag >0 then
            WelcherEintrag = Gruppe + Eintrag
            Auswahlliste.TypeKeys "+"
            Auswahlliste.Select WelcherEintrag
            Auswahlliste.TypeKeys "<Return>"
        end if
    end select

    if LeaveFocus = False then
        Select Case Ucase(gApplication)
        Case "CALC"
            Kontext "DocumentCalc"
        Case "HTML", "HTML"
            Kontext "DocumentWriter"
        Case "WRITER"
            Kontext "DocumentWriter"
        Case "MASTERDOCUMENT"
            Kontext "DocumentMasterDoc"
        end select
    end if
end sub

' ---------------------------------------------------------------

function wNavigatorClose
    '/// Close Navigator
    Kontext "Navigator"
    if Navigator.Exists(2) then
        Navigator.Close
        WaitSlot()
    end if
end function

' ---------------------------------------------------------------

sub wClearDocument
    Dim i as integer : Dim j as integer
    '/// Remove all Text, Drawing-objects or Objects from document ///
    Call wTypeKeys "<PageUp><Home>"
    Call wTypeKeys "<Backspace>",5
    DocumentWriter.MouseDown ( 30,30 )
    DocumentWriter.MouseMove ( 75,60 )
    wait 500
    DocumentWriter.MouseUp ( 75, 60 )
    Sleep 1
    Call wTypeKeys "<Delete>"
    Sleep 3

    Kontext "NavigatorWriter"
    if Not NavigatorWriter.Exists then ViewNavigator
    wait 500

    Kontext "NavigatorWriter"
    if Auswahlliste.GetItemCount <11 then Inhaltsansicht.Click  ' Grundzustand

    if Auswahlliste.GetItemCount >11 then
        For j= 1 to 12
            Auswahlliste.Select j
            Auswahlliste.TypeKeys "-"
        next j
    end if
    wait 500
    for i = 1 to 12
        Auswahlliste.Select i
        Auswahlliste.TypeKeys "+"
        if Auswahlliste.GetItemCount > 11 then
            for j = 1 to 5 ' maximal 5 Elemente in einer Gruppe
                Auswahlliste.TypeKeys "<Down>"
                Auswahlliste.TypeKeys "<Delete>"
                wait 500
                if Auswahlliste.GetItemCount > 11 then Auswahlliste.Select i
            next j
        end if
    next i
    if j= 5 then Warnlog "Try another way to clear page !"

    Kontext "Navigator"
    try
        Navigator.Close
    catch
        Errorlog
        ViewNavigator
    endcatch

    try
        Call wTypeKeys "<Mod1 A>"
    catch
    endcatch
    Call wTypeKeys "<Delete>"
    DocumentWriter.MouseDown ( 50,10 )
    DocumentWriter.MouseUp ( 50,10 )
    Sleep 2
    Call wTypeKeys "<Home><PageUp>"
    Sleep 5
end sub

' ---------------------------------------------------------------

sub wMarkObjects(delete as boolean)
    ' The drawing objects has to be selected before deleting them
    Select Case gApplication
    Case "WRITER"
        Kontext "DocumentWriter"
    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"
    Case "HTML"
        Kontext "DocumentWriterWeb"
    end select

    Call gMouseClick 50,50
    Call wTypeKeys "<PageUp><Home>"
    Call wTypeKeys "<Backspace>",5
    Call gMouseClick 50,50
    Select Case gApplication
    Case "WRITER"
        DocumentWriter.TypeKeys "<Shift F4>"

    Case "MASTERDOCUMENT"
        DocumentMasterDoc.TypeKeys "<Shift F4>"

    Case "HTML"
        DocumentWriterWeb.TypeKeys "<Shift F4>"
    end select

    Sleep 1
    if delete = TRUE then
        Call wTypeKeys "<Delete>"
        Sleep 3
    end if
end sub

' -----------------------------------------------------------------------

sub hExportUmstellung ( WasDenn as Boolean )
    if Ucase(gApplication) = "HTML" then
        ToolsOptions
        Call hToolsOptions("LoadSave","HTMLCompatibility")
        if WasDenn = TRUE then
            'Select Case iSprache
            ' Case 81 : Export.Select "Microsoft Internet Explorer 4.0"
            ' Case else : Export.Select "MS Internet Explorer 4.0"
            'end select
            try
                Export.Select "Microsoft Internet Explorer"
            catch
                Warnlog "Unable to choose browser for export !"
            endcatch
        else
            Export.Select "Netscape Navigator"
        end if
        Kontext "ExtrasOptionenDlg"
        ExtrasOptionenDlg.OK
    end if
end sub

' -----------------------------------------------------------------------

sub wSetMacroSecurityLevel ( wLevel as integer ) as boolean
    ToolsOptions
    Call hToolsOptions("StarOffice","Security")
    wSetMacroSecurityLevel = False
    try
        MacroSecurity.Click
    catch
        Warnlog "Unable to set macro security level (Button 'Macro Security' not found)"
        Goto EarlyExit
    endcatch

    Kontext
    Active.SetPage TabSecurityLevel
    Kontext "TabSecurityLevel"

    Select Case wLevel
    Case 1:     VeryHigh.Check
    Case 2:     High.Check
    Case 3:     Medium.Check
    Case 4:     Low.Check
    Case else:  Warnlog "Wrong level number entered. Unknown"
        goto EarlyExit
    end select
    TabSecurityLevel.Ok
    wSetMacroSecurityLevel = True

    EarlyExit:
    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK

end sub

' -----------------------------------------------------------------------

sub wInsertFrame
    InsertFrame
    Kontext
    Active.SetPage TabType
    Kontext "TabType"
    TabType.OK
    Sleep 3
end sub

' -----------------------------------------------------------------------

sub wRectangleToClipboard
    Dim tempApplication as string
    tempApplication = gApplication
    gApplication = "DRAW"
    Call hNewDocument
    Call hRechteckErstellen ( 45, 45, 60, 60 )
    ' select the drawn object
    try
        EditSelectAll
    catch
        warnlog "Unable to select object. Maybe not drawn!"
    endcatch
    ' copy the selected object
    try
        EditCopy
    catch
        Warnlog "Unable to copy object. Maybe not selected!"
    endcatch

    Call hCloseDocument
    gApplication = tempApplication
    Select Case gApplication
    Case "WRITER"
        Kontext "DocumentWriter"
    Case "MASTERDOCUMENT"
        Kontext "DocumentMasterDoc"
    end select
    Call gMouseClick 10,10
end sub

' -----------------------------------------------------------------------

sub wRectangleToClipboardHTML
    gApplication = "DRAW"
    Call hNewDocument
    Call hRechteckErstellen ( 45, 45, 60, 60 )
    EditSelectAll
    EditCopy
    Call hCloseDocument
    gApplication = "HTML"
    Kontext "DocumentWriterWeb"
    Call gMouseClick
end sub

' -----------------------------------------------------------------------

function MachMirDenEintrag(WoDenn as integer,WieLang as integer, optional Welches as string)
    Call wTypeKeys "<Home>"
    Call wTypeKeys "<Down>",WoDenn
    Call wTypeKeys "<Mod1 Shift Right>" , WieLang
    Kontext "VerzeichniseintragEinfuegen"
    if Welches > "" then
        Select case Welches
        case "Inhalt" : Verzeichnis.Select 1
        case "Stich"  : Verzeichnis.Select 2
        case "Benutz" : Verzeichnis.Select 3
        end select
    end if
    Verzeichniseintrag.TypeKeys "<Up>"
    Wait 500
    EintragOk.Click
end function

' -----------------------------------------------------------------------

sub wOptionsUndo ( sOption$ )
    Dim i as integer
    Dim sTempSeparator as string
    Dim sTempUnit as integer

    Printlog "  - Initial state"

    Call hNewDocument

    Kontext "ExtrasOptionenDlg"
    if Not ExtrasOptionenDlg.Exists then
        ToolsOptions
    end if

    Call hToolsOptions("WRITER","General")
    if Instr(Tabulatorenabstand.Gettext, ",") then
        sTempSeparator = ","
    else
        sTempSeparator = "."
    end if
    sTempUnit = Masseinheit.GetSelIndex

    if sOption$ = "Laden" OR sOption$ = "All" then
        ' Update
        AufNachfrage.Check
        Feldbefehle.Check
        Diagramme.Uncheck
        ' Settings
        Select Case sTempUnit
        Case 1:     'Millimeter
            Tabulatorenabstand.Settext "12" & sTempSeparator & "51"
        Case 2:     ' Centimeter
            Tabulatorenabstand.Settext "1" & sTempSeparator & "25"
        Case 3:     ' Inch
            Tabulatorenabstand.Settext "0" & sTempSeparator & "49"
        Case 4:     ' Pica
            Tabulatorenabstand.Settext "2" & sTempSeparator & "95"
        Case 5:     ' Point
            Tabulatorenabstand.Settext "35" & sTempSeparator & "5"
        end select
    end if

    Call hToolsOptions("WRITER","View")
    if sOption$ = "Inhalte" OR sOption$ = "All" then
        ' Guides
        Hilfslinien.Uncheck
        FarbigeHandles.Check
        GrosseHandles.Uncheck
        ' View
        HorizontaleBildlaufleiste.Check
        VertikaleBildlaufleiste.Check
        Lineal.Check
        HorizontalesLineal.Check
        VertikalesLineal.Check
        WeichesScrollen.Uncheck
        ' Display
        GrafikenUndObjekte.Check
        Tabellen.Check
        Zeichnungen.Check
        Feldname.Uncheck
        Notizen.Check
    end if

    if sOption$ = "Cursor" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","FormattingAids")
        ' Display of
        Absatzenden.UnCheck
        WeicheTrenner.Check
        Leerzeichen.UnCheck
        GeschLeerzeichen.Check
        Tabulatoren.UnCheck
        Umbrueche.UnCheck
        VersteckterText.Uncheck
        VersteckteAbsatze.Check
        'Direct-Cursor
        DirektCursor.Uncheck
        Absatzausrichtung.Check
        'Cursor in protected areas
        Zonen_Cursor.Check
    end if

    if sOption$ = "Raster" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","Grid")
        ' Grid
        FangrasterBenutzen.Uncheck
        RasterSichtbar.Uncheck
        ' Resolution
        AchsenSynchronisieren.Uncheck
        Select Case sTempUnit
        Case 1:     'Millimeter
            RasterAufloesungXAchse.SetText "10" & sTempSeparator & "00"
            RasterAufloesungYAchse.SetText "10" & sTempSeparator & "00"
        Case 2:     ' Centimeter
            RasterAufloesungXAchse.SetText "1" & sTempSeparator & "00"
            RasterAufloesungYAchse.SetText "1" & sTempSeparator & "00"
        Case 3:     ' Inch
            RasterAufloesungXAchse.SetText "0" & sTempSeparator & "39"
            RasterAufloesungYAchse.SetText "0" & sTempSeparator & "39"
        Case 4:     ' Pica
            RasterAufloesungXAchse.SetText "2" & sTempSeparator & "36"
            RasterAufloesungYAchse.SetText "2" & sTempSeparator & "36"
        Case 5:     ' Point
            RasterAufloesungXAchse.SetText "28" & sTempSeparator & "3"
            RasterAufloesungYAchse.SetText "28" & sTempSeparator & "3"
        end select
        RasterUnterteilungXAchse.ToMin
        RasterUnterteilungXAchse.More 1
        RasterUnterteilungYAchse.ToMin
        RasterUnterteilungYAchse.More 1
    end if

    if sOption$ = "Grundschriften" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","BasicFonts")
        Standard.Click
        AktuellesDokument.Uncheck
    end if

    if sOption$ = "Drucken" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","Print")
        ' Contents
        Grafiken.Check
        Tabellen.Check
        Zeichnungen.Check
        Kontrollfelder.Check
        Hintergrund.Check
        SchwarzDrucken.Uncheck
        ' Pages
        LinkeSeiten.Check
        RechteSeiten.Check
        Umgekehrt.Uncheck
        Prospekt.Uncheck
        ' Notes
        Keine.Check
        ' Other
        EinzelneDruckauftraege.Uncheck
        AusDruckereinstellung.Uncheck
        Fax.SetNoSelection
    end if

    if sOption$ = "Tabelle" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","Table")
        ' Default
        Ueberschrift.Check
        Wiederholen.Check
        NichtTrennen.Uncheck
        Umrandung.Check
        ' Input in Tables
        AutomatischeZahlenerkennung.Check
        Zahlenformaterkennung.Check
        AutomatischeAusrichtung.Check
        AutomatischeZahlenerkennung.UnCheck
        ' Keyboard handling
        Select Case sTempUnit
        Case 1:     'Millimeter
            VerschiebenZeile.SetText "4" & sTempSeparator & "99"
            VerschiebenSpalte.SetText "4" & sTempSeparator & "99"
            EinfuegenZeile.SetText "4" & sTempSeparator & "99"
            EinfuegenSpalte.SetText "24" & sTempSeparator & "99"
        Case 2:     ' Centimeter
            VerschiebenZeile.SetText "0" & sTempSeparator & "50"
            VerschiebenSpalte.SetText "0" & sTempSeparator & "50"
            EinfuegenZeile.SetText "0" & sTempSeparator & "50"
            EinfuegenSpalte.SetText "2" & sTempSeparator & "50"
        Case 3:     ' Inch
            VerschiebenZeile.SetText "0" & sTempSeparator & "20"
            VerschiebenSpalte.SetText "0" & sTempSeparator & "20"
            EinfuegenZeile.SetText "0" & sTempSeparator & "20"
            EinfuegenSpalte.SetText "0" & sTempSeparator & "98"
        Case 4:     ' Pica
            VerschiebenZeile.SetText "1" & sTempSeparator & "18"
            VerschiebenSpalte.SetText "1" & sTempSeparator & "18"
            EinfuegenZeile.SetText "1" & sTempSeparator & "18"
            EinfuegenSpalte.SetText "5" & sTempSeparator & "90"
        Case 5:     ' Point
            VerschiebenZeile.SetText "14" & sTempSeparator & "2"
            VerschiebenSpalte.SetText "14" & sTempSeparator & "2"
            EinfuegenZeile.SetText "14" & sTempSeparator & "2"
            EinfuegenSpalte.SetText "70" & sTempSeparator & "9"
        end select
        Sleep 1
        ' Behaviour of rows/columns
        Variabel.Check
    end if

    if sOption$ = "Aenderung" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","Changes")
        ' Text display
        EinfuegenAttribute.Select 4
        EinfuegenFarbe.Select 2
        LoeschenAttribute.Select 4
        LoeschenFarbe.Select 2
        AendernAttribute.Select 2
        AendernFarbe.Select 2
        ' Lines changed
        Zeilenmarkierung.Select 2
        Zeilenfarbe.Select 1
    end if

    if sOption$ = "AutoCaption" OR sOption$ = "All" then
        Call hToolsOptions("WRITER","Autocaption")
        for i = 1 to ObjectList.GetItemCount
            ObjectList.Select i
            ObjectList.UnCheck
        next i
    end if

    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK

    Call hCloseDocument
end sub

' -----------------------------------------------------------------------

function wInsertDocumentinMasterDoc(DocumentName as string) as boolean
    Call hNewDocument
    Call hFileOpen(DocumentName)
    Sleep 2
    Call wTypeKeys "<Mod1 A>"
    Sleep 2
    EditCopy
    Call hCloseDocument
    wInsertDocumentinMasterDoc = True
end function

' -----------------------------------------------------------------------

function CheckForFilters() as boolean
    Kontext "GraphicFilterBar"
    if not GraphicFilterBar.Exists then
        Warnlog "- Toolbox has been closed!"
        Kontext "GraphicObjectbar"
        if Filter.IsEnabled then
            GraphicObjectbar.TearOff Filter
            Kontext "GraphicFilterBar"
            GraphicFilterBar.Move ( 20, 20 )
            CheckForFilters = True
        else
            Warnlog "- Though graphic is selected, the filter button in objectbar is disabled!"
            Select Case gApplication
            Case "WRITER"
                Kontext "DocumentWriter"
                DocumentWriter.MouseDoubleClick 10,10
                DocumentWriter.MouseDown 50,20
                DocumentWriter.MouseUp 50,20
            case else
                Kontext "DocumentMasterDoc"
                DocumentMasterDoc.MouseDoubleClick 10,10
                DocumentMasterDoc.MouseDown 50,20
                DocumentMasterDoc.MouseUp 50,20
            end select
            Wait 500
            Kontext "GraphicObjectbar"
            if Filter.IsEnabled then
                GraphicObjectbar.TearOff Filter
                Kontext "GraphicFilterBar"
                GraphicFilterBar.Move ( 20, 20 )
                CheckForFilters = True
            else
                Warnlog "- Reselecting the graphic didn't enable the button in the toolbar! No further test!"
                CheckForFilters = False
            end if
        end if
    else
        CheckForFilters=True
    end if
    Kontext "GraphicFilterBar"
end function

' -----------------------------------------------------------------------

sub hInsertFloatingFrame
    Sleep 3
    InsertFloatingFrame
    Sleep 3
    Kontext "TabEigenschaften"
    FrameName.SetText "Hallo"
    TabEigenschaften.OK
    Sleep 2
    Kontext "OeffnenDlg"
    if OeffnenDlg.Exists(2) then OeffnenDlg.Cancel
end sub

' -----------------------------------------------------------------------

function wStyleCreate( sStyleName as string, sType as string, optional NotFromSelection as boolean ) as boolean
    '/// This function creates a new style through stylist

    Kontext "Stylist"
    If Not Stylist.Exists then FormatStylist

    select case sType
    case "Paragraph":	Absatzvorlagen.Click
    case "Character":	Zeichenvorlagen.Click
    case "Frame":		Rahmenvorlagen.Click
    case "Page":		Seitenvorlagen.Click
    case "Numbering":	Numerierungsvorlagen.Click
    end select

    if IsMissing ( NotFromSelection ) then
        wait 500
        AusSelektion.OpenMenu
        Sleep 1
        Call hMenuSelectNr(1)
        Sleep 1
        wait 500
        Kontext "VorlageErzeugen"
        Vorlagenname.Settext sStyleName
        VorlageErzeugen.Ok
    else
        if NotFromSelection = true then
            VorlagenListe.TypeKeys "<Mod1 End>"
            Vorlagenliste.TypeKeys "<Mod1 Home>"
            Vorlagenliste.OpenContextMenu
            Sleep 1
            Call hMenuSelectNr(1)
            wait 500
            Kontext
            Active.SetPage TabVerwalten
            wait 500
            Kontext "TabVerwalten"
            VorlagenName.SetText sStyleName
            wait 500
            TabVerwalten.OK
        end if
    end if

    Kontext "Stylist"

    if wStyleSelect ( sStyleName, sType ) = true then
        wStyleCreate = False
    else
        wStyleCreate = True
    end if
    Stylist.Close
end function

' -----------------------------------------------------------------------

function wStyleSelect( sStyleName as string, optional sType as string ) as boolean
    '/// This function selects a given style in Stylist
    '/// function leaves Stylist opened

    Dim i as integer

    Kontext "Stylist"
    If Not Stylist.Exists then FormatStylist

    wait 500
    Gruppenliste.Select 2	'-> 'All Styles' has to be selected
    wait 500
    if IsMissing (sType) then
        Absatzvorlagen.Click
    else
        select case sType
        case "Paragraph":	Absatzvorlagen.Click
        case "Character":	Zeichenvorlagen.Click
        case "Frame":		Rahmenvorlagen.Click
        case "Page":		Seitenvorlagen.Click
        case "Numbering":	Numerierungsvorlagen.Click
        end select
    end if

    Sleep 1
    Vorlagenliste.Select 1
    wait 500
    if Vorlagenliste.GetSelText <> sStyleName then
        For i = 1 to 200
            if Vorlagenliste.GetSelText = sStyleName then
                wStyleSelect = true
                i = 202
            else
                Vorlagenliste.TypeKeys "<Down>"
            end if
        next i
        if i = 202 then wStyleSelect = true
    else
        wStyleSelect = true
    end if

end function

' -----------------------------------------------------------------------

function wStyleDelete ( sStyleName as string, sType as string ) as boolean
    '/// This function selects a given style in Stylist
    '/// function leaves Stylist opened

    Dim i as integer

    Kontext "Stylist"
    If Not Stylist.Exists then FormatStylist

    select case sType
    case "Paragraph":	Absatzvorlagen.Click
    case "Character":	Zeichenvorlagen.Click
    case "Frame":		Rahmenvorlagen.Click
    case "Page":		Seitenvorlagen.Click
    case "Numbering":	Numerierungsvorlagen.Click
    end select

    Vorlagenliste.TypeKeys "<Mod1 End>"
    Vorlagenliste.TypeKeys "<Mod1 Home>"
    if Vorlagenliste.GetSelText <> sStyleName then
        For i = 1 to 200
            if Vorlagenliste.GetSelText = sStyleName then
                Vorlagenliste.OpenContextMenu
                Sleep 1
                Call hMenuSelectNr(3)
                wait 500
                Kontext "Active"
                if Active.Exists then
                    if Active.GetRT = 304 then
                        Active.Yes
                        i = 203
                    end if
                end if
            else
                Vorlagenliste.TypeKeys "<Down>"
            end if
        next i
        if i = 204 then wStyleDelete = true
    else
        Vorlagenliste.OpenContextMenu
        Sleep 1
        Call hMenuSelectNr(3)
        wait 500
        Kontext "Active"
        if Active.Exists then
            if Active.GetRT = 304 then
                Active.Yes
            end if
        end if
        wStyleDelete = true
    end if

end function

' -----------------------------------------------------------------------

function wStyleSet( sStyleName as string, optional sType as string ) as boolean
    '/// This function sets a given style in Stylist
    '/// function leaves Stylist opened

    Dim i as integer

    Kontext "Stylist"
    If Not Stylist.Exists then FormatStylist

    wait 500
    Gruppenliste.Select 2	'-> 'All Styles' has to be selected
    wait 500
    if IsMissing (sType) then
        Absatzvorlagen.Click
    else
        select case sType
        case "Paragraph":	Absatzvorlagen.Click
        case "Character":	Zeichenvorlagen.Click
        case "Frame":		Rahmenvorlagen.Click
        case "Page":		Seitenvorlagen.Click
        case "Numbering":	Numerierungsvorlagen.Click
        end select
    end if

    Sleep 1
    Vorlagenliste.Select 1
    wait 500
    if Vorlagenliste.GetSelText <> sStyleName then
        For i = 1 to 200
            if Vorlagenliste.GetSelText = sStyleName then
                wStyleSet = true
                Vorlagenliste.TypeKeys "<Return>"
                exit for
            else
                Vorlagenliste.TypeKeys "<Down>"
            end if
        next i
    else
        wStyleSet = true
    end if

end function

' -----------------------------------------------------------------------

function wStyleGet( sStyleName as string, optional sType as string ) as boolean
    '/// This function checks if a given style is selected in Stylist
    '/// function leaves Stylist opened

    Dim i as integer

    Kontext "Stylist"
    If Not Stylist.Exists then FormatStylist

    wait 500
    Gruppenliste.Select 2	'-> 'All Styles' has to be selected
    wait 500
    if IsMissing (sType) then
        Absatzvorlagen.Click
    else
        select case sType
        case "Paragraph":	Absatzvorlagen.Click
        case "Character":	Zeichenvorlagen.Click
        case "Frame":		Rahmenvorlagen.Click
        case "Page":		Seitenvorlagen.Click
        case "Numbering":	Numerierungsvorlagen.Click
        end select
    end if

    wait 500
    if Vorlagenliste.GetSelText = sStyleName then
        wStyleGet = true
    end if

end function