-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PlanMaker.au3
1951 lines (1716 loc) · 69.5 KB
/
PlanMaker.au3
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
; :wrap=none:noTabs=false:collapseFolds=0:maxLineLen=80:mode=autoitscript:tabSize=4:indentSize=4:noWordSep=_@:deepIndent=false:wordBreakChars=,+-\=<>/?^&*:folding=indent:
#include-once
; _PlanMaker.au3 V0.52
; Thorsten Willert
; Wed Nov 20 11:38:35 CET 2019 @485 /Internet-Zeit/
; Tested with Sofmaker-Office: Planmaker 2016, 2018 and FreeOffice
#cs
V0.52
added: constants for datatypes
V.51
tested with PlanMaker 2018
added: Console-output to __PlanMaker_COMErrFunc
V.50
added: _PlanMaker_RangeFormat
added: _PlanMaker_RangeMethode
V0.40
added: _PlanMaker_PageSetup
added: _PlanMaker_Print
example:
V0.30
added: _PlanMaker_FormatNumber
V0.20
added: _PlanMaker_FormatShading
changed: _PlanMaker_FormatFont (range as object or string)
changed: _PlanMaker_FormatBorder* (range as object or string)
changed: _PlanMaker_SheetFromArray (range as object or string)
changed: _PlanMaker_BookAttach (supports now only the "filename", too)
changed: __IsRange (checks now for object-name "IDocRange", too)
optimized: _PlanMaker_ScreenUpdate
V0.17
added: _PlanMaker_FormatBorder
added: _PlanMaker_FormatBorders
added: _PlanMaker_FormatBorder_All
added: _PlanMaker_FormatBorder_Frame
added: _PlanMaker_FormatBorder_Inner
fixed: _FormatFont(error: ManualApply)
V0.16
fixed: various Au3Check warnings
added: Constants for cell-borders, type and texture
V0.15
added: constants for named color-values
added: function _PlanMaker_Color2SmoColor (converts Int-RGB OR Hex-RGB values to SoftMaker-Office HEX-BGR values)
#ce
#cs
; #CURRENT# ====================================================================
_PlanMaker_BookAttach
_PlanMaker_BookClose
_PlanMaker_BookNew
_PlanMaker_BookOpen
_PlanMaker_BookSave
_PlanMaker_BookSaveAs
_PlanMaker_CellRangeByPosition
_PlanMaker_CellRead
_PlanMaker_CellWrite
_PlanMaker_DocumentPropertyGet
_PlanMaker_DocumentPropertyGetAll
_PlanMaker_DocumentPropertySet
_PlanMaker_FormatBorder
_PlanMaker_FormatBorders
_PlanMaker_FormatBorder_All
_PlanMaker_FormatBorder_Frame
_PlanMaker_FormatBorder_Inner
_PlanMaker_FormatFont
_PlanMaker_FormatNumber
_PlanMaker_FormatShading
_PlanMaker_FormulaRead
_PlanMaker_FormulaWrite
_PlanMaker_PageSetup
_PlanMaker_Quit
_PlanMaker_RGB2SmoColor
_PlanMaker_ScreenUpdate
_PlanMaker_SheetActivate
_PlanMaker_SheetAddNew
_PlanMaker_SheetDelete
_PlanMaker_SheetList
_PlanMaker_SheetFromArray
_PlanMaker_SheetToArray
_PlanMaker_UserPropertyGet
_PlanMaker_UserPropertyGetAll
_PlanMaker_UserPropertySet
__ConvertToLetter
__IsRange
#ce
;Konstanten aus dem BasicMaker Handbuch
Global Enum $_smoDoNotSaveChanges = 0, _
$_smoPromptToSaveChanges, _
$_smoSaveChanges
#cs
WindowState
smoWindowStateNormal = 1 ' normal
smoWindowStateMinimize = 2 ' minimiert
smoWindowStateMaximize = 3 ' maximiert
Calculation
pmCalculationAutomatic = 0 ' Berechnungen automatisch aktualisieren
pmCalculationManual = 1 ' Berechnungen manuell aktualisieren
DisplayCommentIndicator
pmNoIndicator = 0 ' Weder Kommentare noch gelbes Dreieck
pmCommentIndicatorOnly = 1 ' Nur ein gelbes Hinweisdreieck in der Zelle
pmCommentOnly = 2 ' Kommentare zeigen, aber kein Hinweisdreieck
pmCommentAndIndicator = 3 ' Sowohl Kommentare als auch Dreieck zeigen
#ce
;Userproperty
Global Enum $_smoUserHomeAddressName = 1, _ ; Nachname (privat)
$_smoUserHomeAddressFirstName, _ ; Vorname (privat)
$_smoUserHomeAddressStreet, _ ; Straß (privat)
$_smoUserHomeAddressZip, _ ; Postleitzahl (privat)
$_smoUserHomeAddressCity, _ ; Stadt (privat)
$_smoUserHomeAddressPhone1, _ ; Telefon (privat)
$_smoUserHomeAddressFax, _ ; Telefax (privat)
$_smoUserHomeAddressEmail, _ ; E-Mail-Adresse (privat)
$_smoUserHomeAddressPhone2, _ ; Mobiltelefon o.Ä. (privat)
$_smoUserHomeAddressHomepage, _ ; Homepage (privat)
$_smoUserBusinessAddressName, _ ; Nachname (geschÄftlich)
$_smoUserBusinessAddressFirstName, _ ; Vorname (geschÄftlich)
$_smoUserBusinessAddressCompany, _ ; Firma (geschÄftlich)
$_smoUserBusinessAddressDepartment, _ ; Abteilung (geschÄftlich)
$_smoUserBusinessAddressStreet, _ ; Straß (geschÄftlich)
$_smoUserBusinessAddressZip, _ ; Postleitzahl (geschÄftlich)
$_smoUserBusinessAddressCity, _ ; Stadt (geschÄftlich)
$_smoUserBusinessAddressPhone1, _ ; Telefon (geschÄftlich)
$_smoUserBusinessAddressFax, _ ; Telefax (geschÄftlich)
$_smoUserBusinessAddressEmail, _ ; E-Mail-Adresse (geschÄftlich)
$_smoUserBusinessAddressPhone2, _ ; Mobiltelefon o.Ä. (geschÄftlich)
$_smoUserBusinessAddressHomepage, _ ; Homepage (geschÄftlich)
$_smoUserHomeAddressInitials, _ ; Initialen des Benutzers (privat)
$_smoUserBusinessAddressInitials ; Initialen des Benutzers (geschÄftlich)
;FileFormat (UnabhÄngig vom Übergebenen Parameter FileFormat versucht PlanMaker stets, das Dateiformat selbst zu erkennen,
; und ignoriert offensichtlich falsche Angaben)
Global Enum $_pmFormatDocument = 0, _ ; 0 PlanMaker-Dokument - dies ist die Standardeinstellung
$_pmFormatTemplate, _ ; 1 PlanMaker-Dokumentvorlage
$_pmFormatExcel97, _ ; 2 Excel 97/2000/XP
$_pmFormatExcel5, _ ; 3 Excel 5.0/7.0
$_pmFormatExcelTemplate, _ ; 4 Excel-Dokumentvorlage
$_pmFormatSYLK, _ ; 5 Sylk
$_pmFormatRTF, _ ; 7 Rich Text Format
$_pmFormatTextMaker = 7, _ ; 7 TextMaker (= RTF)
$_pmFormatHTML, _ ; 8 HTML-Dokument
$_pmFormatdBaseDOS, _ ; 9 dBASE-Datenbank mit DOS-Zeichensatz
$_pmFormatdBaseAnsi, _ ; 10 dBASE-Datenbank mit Windows-Zeichensatz
$_pmFormatDIF, _ ; 11 Textdatei mit Windows-Zeichensatz
$_pmFormatPlainTextAnsi, _ ; 12 Textdatei mit Windows-Zeichensatz
$_pmFormatPlainTextDOS, _ ; 13 Textdatei mit DOS-Zeichensatz
$_pmFormatPlainTextUnix, _ ; 14 Textdatei mit ANSI-Zeichensatz fÜr UNIX, Linux und FreeBSD
$_pmFormatPlainTextUnicode, _ ; 15 Textdatei mit Unicode-Zeichensatz
$_pmFormatdBaseUnicode = 19, _ ; 18 dBASE-Datenbank mit Unicode-Zeichensatz
$_pmFormatPlainTextUTF8 = 21, _ ; 21 Textdatei mit UTF8-Zeichensatz
$_pmFormatMSXML = 23, _ ; 23 Excel ab 2007 (.xlsx)
$_pmFormatPM2008 = 26, _ ; 26 PlanMaker 2008-Dokument
$_pmFormatPM2010 ; 27 PlanMaker 2010-Dokument
;TextMarker (Gibt bei den Textdatei-Formaten an, mit welchem Zeichen Textfelder umgeben sind)
Global Enum $_pmImportTextMarkerNone = 0, _ ; Text ist nicht speziell markiert
$_pmImportTextMarkerApostrophe, _ ; Apostrophe
$_pmImportTextMarkerQmark ; AnfÜhrungszeichen
;DocumentProperty
Global Enum $_smoPropertyTitle = 1, _ ; "Title"
$_smoPropertySubject, _ ; "Subject"
$_smoPropertyAuthor, _ ; "Author"
$_smoPropertyKeywords, _ ; "Keywords"
$_smoPropertyComments, _ ; "Comments"
$_smoPropertyAppName, _ ; "Application name"
$_smoPropertyTimeLastPrinted, _ ; "Last print date"
$_smoPropertyTimeCreated, _ ; "Creation date"
$_smoPropertyTimeLastSaved, _ ; "Last save time"
$_smoPropertyPages = 18, _ ; "Number of pages"
$_smoPropertyCells, _ ; "Number of cells"
$_smoPropertyTextCells, _ ; "Number of cells with text"
$_smoPropertyNumericCells, _ ; "Number of cells with numbers"
$_smoPropertyFormulaCells, _ ; "Number of cells with formulas"
$_smoPropertyNotes, _ ; "Number of comments"
$_smoPropertySheets, _ ; "Number of worksheets"
$_smoPropertyCharts, _ ; "Number of charts"
$_smoPropertyPictures, _ ; "Number of pictures"
$_smoPropertyOLEObjects, _ ; "Number of OLE objects"
$_smoPropertyDrawings, _ ; "Number of drawings"
$_smoPropertyTextFrames ; "Number of text frames"
;smoPropertyKeystrokes = 10 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyCharacters = 11 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyWords = 12 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertySentences = 13 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyParas = 14 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyChapters = 15 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertySections = 16 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyLines = 17 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyTables = 30 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyFootnotes = 31 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyAvgWordLength = 32 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyAvgCharactersSentence = 33 ' - (bei PlanMaker nicht verfÜgbar)
;smoPropertyAvgWordsSentence = 34 ' - (bei PlanMaker nicht verfÜgbar)
; Type
Global Enum $_smoPropertyTypeBoolean = 0, _ ; Boolean
$_smoPropertyTypeDate, _ ; Datum
$_smoPropertyTypeFloat, _ ; Fliesskommawert
$_smoPropertyTypeNumber, _ ; Ganzzahl
$_smoPropertyTypeString ; Zeichenkette
; Orientation
Global Enum $_smoOrientLandscape = 0, _ ; Querformat
$_smoOrientPortrait; Hochformat
; PaperSize
Global Const $_smoPaperCustom = -1
Global Enum $_smoPaperLetter = 1, _
$_smoPaperLetterSmall, _
$_smoPaperTabloid, _
$_smoPaperLedger, _
$_smoPaperLegal, _
$_smoPaperStatement, _
$_smoPaperExecutive, _
$_smoPaperA3, _
$_smoPaperA4, _
$_smoPaperA4Small, _
$_smoPaperA5, _
$_smoPaperB4, _
$_smoPaperB5, _
$_smoPaperFolio, _
$_smoPaperQuarto, _
$_smoPaper10x14, _
$_smoPaper11x17, _
$_smoPaperNote, _
$_smoPaperEnvelope9, _
$_smoPaperEnvelope10, _
$_smoPaperEnvelope11, _
$_smoPaperEnvelope12, _
$_smoPaperEnvelope14, _
$_smoPaperCSheet, _
$_smoPaperDSheet, _
$_smoPaperESheet, _
$_smoPaperEnvelopeDL, _
$_smoPaperEnvelopeC5, _
$_smoPaperEnvelopeC3, _
$_smoPaperEnvelopeC4, _
$_smoPaperEnvelopeC6, _
$_smoPaperEnvelopeC65, _
$_smoPaperEnvelopeB4, _
$_smoPaperEnvelopeB5, _
$_smoPaperEnvelopeB6, _
$_smoPaperEnvelopeItaly, _
$_smoPaperEnvelopeMonarch, _
$_smoPaperEnvelopePersonal, _
$_smoPaperFanfoldUS, _
$_smoPaperFanfoldStdGerman, _
$_smoPaperFanfoldLegalGerman
; PrintComments
Global Enum $_pmPrintNoComments = 0, _ ; Keine Kommentare drucken
$_pmPrintInPlace ; Kommentare ausdrucken
; Order
Global Enum $_pmOverThenDown = 0, _ ; Von links nach rechts
$_pmDownThenOver = 1 ; Von oben nach unten
; HorizontalAlignment
Global Enum $_pmHAlignGeneral = 0, _ ; Standard
$_pmHAlignLeft, _ ; Linksbuendig
$_pmHAlignRight, _ ; Rechtsbuendig
$_pmHAlignCenter, _ ; Zentriert
$_pmHAlignJustify, _ ; Blocksatz
$_pmHAlignCenterAcrossSelection ; Zentriert Ueber Spalten
; VerticalAlignment
Global Enum $_pmVAlignTop = 0, _ ; Oben
$_pmVAlignCenter, _ ; Zentriert
$_pmVAlignBottom, _ ; Unten
$_pmVAlignJustify ; Vertikaler Blocksatz
; Type
Global Enum $_pmNumberGeneral = 0, _ ; Standard
$_pmNumberDecimal, _ ; Zahl
$_pmNumberScientific, _ ; Wissenschaftlich
$_pmNumberFraction, _ ; Bruch (fuer den Nenner siehe Digits-Eigenschaft)
$_pmNumberDate, _ ; Datum/Uhrzeit (siehe Hinweis)
$_pmNumberPercentage, _ ; Prozent
$_pmNumberCurrency, _ ; Waehrung (siehe Hinweis)
$_pmNumberBoolean, _ ; Wahrheitswert
$_pmNumberCustom, _ ; Benutzerdefiniert (siehe Hinweis)
$_pmNumberText, _ ; Text
$_pmNumberAccounting ; Buchhaltung (siehe Hinweis)
#cs
Currency
EUR Euro
USD US Dollar
CAD Kanadische Dollar
AUD Australische Dollar
JPY Japanische Yen
RUB Russische Rubel
BEF Belgische Francs
CHF Schweizer Franken
DEM Deutsche Mark
ESP Spanische Peseten
FRF Franzoesische Francs
LUF Luxemburgische Francs
NLG Niederlaendische Gulden
PTE Portugiesische Escudos
#ce
; Color
Global Const $_smoColorAutomatic = -1 ; Automatisch (siehe BasicMaker-Manual)
Global Const $_smoColorTransparent = -1 ; Transparent (siehe BasicMaker-Manual)
Global Const $_smoColorBlack = "&h0"
Global Const $_smoColorBlue = "&hFF0000"
Global Const $_smoColorBrightGreen = "&h00FF00"
Global Const $_smoColorRed = "&h0000FF"
Global Const $_smoColorYellow = "&h00FFFF"
Global Const $_smoColorTurquoise = "&hFFFF00"
Global Const $_smoColorViolet = "&h800080"
Global Const $_smoColorWhite = "&hFFFFFF"
Global Const $_smoColorIndigo = "&h993333"
Global Const $_smoColorOliveGreen = "&h003333"
Global Const $_smoColorPaleBlue = "&hFFCC99"
Global Const $_smoColorPlum = "&h663399"
Global Const $_smoColorRose = "&hCC99FF"
Global Const $_smoColorSeaGreen = "&h669933"
Global Const $_smoColorSkyBlue = "&hFFCC00"
Global Const $_smoColorTan = "&h99CCFF"
Global Const $_smoColorTeal = "&h808000"
Global Const $_smoColorAqua = "&hCCCC33"
Global Const $_smoColorBlueGray = "&h996666"
Global Const $_smoColorBrown = "&h003399"
Global Const $_smoColorGold = "&h00CCFF"
Global Const $_smoColorGreen = "&h008000"
Global Const $_smoColorLavender = "&hFF99CC"
Global Const $_smoColorLime = "&h00CC99"
Global Const $_smoColorOrange = "&h0066FF"
Global Const $_smoColorPink = "&hFF00FF"
Global Const $_smoColorLightBlue = "&hFF6633"
Global Const $_smoColorLightOrange = "&h0099FF"
Global Const $_smoColorLightYellow = "&h99FFFF"
Global Const $_smoColorLightGreen = "&hCCFFCC"
Global Const $_smoColorLightTurquoise = "&hFFFFCC"
Global Const $_smoColorDarkBlue = "&h800000"
Global Const $_smoColorDarkGreen = "&h003300"
Global Const $_smoColorDarkRed = "&h000080"
Global Const $_smoColorDarkTeal = "&h663300"
Global Const $_smoColorDarkYellow = "&h008080"
Global Const $_smoColorGray05 = "&hF3F3F3"
Global Const $_smoColorGray10 = "&hE6E6E6"
Global Const $_smoColorGray125 = "&hE0E0E0"
Global Const $_smoColorGray15 = "&hD9D9D9"
Global Const $_smoColorGray20 = "&hCCCCCC"
Global Const $_smoColorGray25 = "&hC0C0C0"
Global Const $_smoColorGray30 = "&hB3B3B3"
Global Const $_smoColorGray35 = "&hA6A6A6"
Global Const $_smoColorGray375 = "&hA0A0A0"
Global Const $_smoColorGray40 = "&h999999"
Global Const $_smoColorGray45 = "&h8C8C8C"
Global Const $_smoColorGray50 = "&h808080"
Global Const $_smoColorGray55 = "&h737373"
Global Const $_smoColorGray60 = "&h666666"
Global Const $_smoColorGray625 = "&h606060"
Global Const $_smoColorGray65 = "&h595959"
Global Const $_smoColorGray75 = "&h404040"
Global Const $_smoColorGray85 = "&h262626"
Global Const $_smoColorGray90 = "&h191919"
Global Const $_smoColorGray70 = "&h4C4C4C"
Global Const $_smoColorGray80 = "&h333333"
Global Const $_smoColorGray875 = "&h202020"
Global Const $_smoColorGray95 = "&hC0C0C0"
;ColorIndex
Global Enum $_smoColorIndexAutomatic = -1, _ ; Automatisch (siehe unten)
$_smoColorIndexTransparent = -1, _ ; Transparent (siehe unten)
$_smoColorIndexBlack = 0, _ ; Schwarz
$_smoColorIndexBlue, _ ; Blau
$_smoColorIndexCyan, _ ; Zyanblau
$_smoColorIndexGreen, _ ; GrÜn
$_smoColorIndexMagenta, _ ; Magenta
$_smoColorIndexRed, _ ; Rot
$_smoColorIndexYellow, _ ; Gelb
$_smoColorIndexWhite, _ ; Wei߸
$_smoColorIndexDarkBlue, _ ; Dunkelblau
$_smoColorIndexDarkCyan, _ ; Dunkles Zyanblau
$_smoColorIndexDarkGreen, _ ; DunkelgrÜn
$_smoColorIndexDarkMagenta, _ ; Dunkles Magenta
$_smoColorIndexDarkRed, _ ; Dunkelrot
$_smoColorIndexBrown, _ ; Braun
$_smoColorIndexDarkGray, _ ; Dunkelgrau
$_smoColorIndexLightGray ; Hellgrau
;Underline
Global Enum $_pmUnderlineNone = 0, _ ; aus
$_pmUnderlineSingle, _ ; einfach durchgehend
$_pmUnderlineDouble, _ ; doppelt durchgehend
$_pmUnderlineWords, _ ; einfach wortweise
$_pmUnderlineWordsDouble ; doppelt wortweise
; Borders
Global Enum Step -1 $_pmBorderTop = -1, _ ;Linie oberhalb der Zellen
$_pmBorderLeft, _ ; Linie links der Zellen
$_pmBorderBottom, _ ; Linie unterhalb der Zellen
$_pmBorderRight, _ ; Linie rechts der Zellen
$_pmBorderHorizontal, _ ; Horizontale Gitternetzlinien
$_pmBorderVertical ;Vertikale Gitternetzlinien
; Type
Global Enum $_pmLineStyleNone = 0, _ ; Keine Linie
$_pmLineStyleSingle, _ ; Einfache Linie
$_pmLineStyleDouble ; Doppelte Linie
; Texture
Global Enum $_smoPatternNone = 0, _ ;(Kein Muster)
$_smoPatternHalftone, _
$_smoPatternRightDiagCoarse, _
$_smoPatternLeftDiagCoarse, _
$_smoPatternHashDiagCoarse, _
$_smoPatternVertCoarse, _
$_smoPatternHorzCoarse, _
$_smoPatternHashCoarse, _
$_smoPatternRightDiagFine, _
$_smoPatternLeftDiagFine, _
$_smoPatternHashDiagFine, _
$_smoPatternVertFine, _
$_smoPatternHorzFine, _
$_smoPatternHashFine
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookAttach
; Description ...:
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookAttach($sFileName)
; Parameter(s): .: $sFileName - Filename or path with filename
; Return Value ..: Success - Object of the workbook
; Failure - 0
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Mon Jun 19 00:32:28 CEST 2017 @980 /Internet-Zeit/
; Version .......: 0.3
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookAttach($sFileName)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not FileExists($sFileName) Then Return SetError(1, 1, 0)
Local $oPM = ObjGet("", "PlanMaker.Application")
If @error Or Not IsObj($oPM) Then Return SetError(2, @error, 0)
Local $iCount = $oPM.Application.Workbooks.Count
For $i = 1 To $iCount
If $sFileName = $oPM.Application.Workbooks.Item($i).FullName Or _
$sFileName = $oPM.Application.Workbooks.Item($i).Name Then Return SetError(0, 0, $oPM.Application.ActiveWorkbook)
Next
Return SetError(3, 1, 0)
EndFunc ;==>_PlanMaker_BookAttach
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookClose
; Description ...: Closes the current workbook
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookClose(ByRef $oPM[, $Option = $smoSaveChanges])
; Parameter(s): .: $oPM -
; $Option - Optional: (Default = $smoSaveChanges) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....:
; Date ..........: Thu Mar 23 16:11:04 CET 2017
; Version .......: 0.1
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookClose(ByRef $oWB, $Option = $_smoSaveChanges)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oWB) Then Return SetError(1, 1, 0)
$oWB.Close($Option)
Return SetError(0, 0, 1)
EndFunc ;==>_PlanMaker_BookClose
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookNew
; Description ...: Adds a new workbook
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookNew([$bVisible = False[, $bActivate = False]])
; Parameter(s): .: $bVisible - Optional: (Default = False) :
; $bActivate - Optional: (Default = False) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Mon Mar 27 23:25:57 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookNew($bVisible = False, $bActivate = False)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
Local $oPM = ObjCreate("PlanMaker.Application")
If @error Or Not IsObj($oPM) Then Return SetError(1, @error, 0)
Local $oWB = $oPM.Workbooks.Add
If @error Or Not IsObj($oWB) Then Return SetError(1, @error, 0)
$oPM.Visible = $bVisible
$oWB.Activate = $bActivate
Return SetError(0, 0, $oWB)
EndFunc ;==>_PlanMaker_BookNew
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookOpen
; Description ...: Opens a existing workbook
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookOpen($sFileName[, $bVisible = False[, $bActivate = False]])
; Parameter(s): .: $sFileName -
; $bVisible - Optional: (Default = False) :
; $bActivate - Optional: (Default = False) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Mon Mar 27 10:41:39 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookOpen($sFileName, $bVisible = False, $bActivate = False)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not FileExists($sFileName) Then Return SetError(1, 1, 0)
Local $oPM = ObjCreate("PlanMaker.Application")
If @error Or Not IsObj($oPM) Then Return SetError(2, @error, 0)
Local $iCount = $oPM.Application.Workbooks.Count
For $i = 1 To $iCount
If $sFileName = $oPM.Application.Workbooks.Item($i).FullName Then Return SetError(3, 1, $oPM.Application.ActiveWorkbook)
Next
Local $oWB = $oPM.Workbooks.Open($sFileName)
$oPM.Visible = $bVisible
$oWB.Activate = $bActivate
Return SetError(0, 0, $oWB)
EndFunc ;==>_PlanMaker_BookOpen
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookSave
; Description ...: Saves the current workbook
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookSave(ByRef $oPM)
; Parameter(s): .: $oPM -
; Return Value ..: Success -
; Failure -
; Author(s) .....: Thorsten Willert
; Date ..........: Thu Mar 23 16:09:59 CET 2017
; Version .......: 0.1
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookSave(ByRef $oWB)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oWB) Then Return SetError(1, 1, 0)
$oWB.Save
Return SetError(0, 0, $oWB.Saved)
EndFunc ;==>_PlanMaker_BookSave
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_BookSaveAs
; Description ...: Saves the current workbook as ...
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_BookSaveAs(ByRef $oPM, $sFileName[, $iFileFormat = $_pmFormatDocument[, $sDelimiter = @TAB[, $sTextmarker = $_pmImportTextMarkerNone]]])
; Parameter(s): .: $oPM -
; $sFileName -
; $iFileFormat - Optional: (Default = $_pmFormatDocument) :
; $sDelimiter - Optional: (Default = @TAB) :
; $sTextmarker - Optional: (Default = $_pmImportTextMarkerNone) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Sun Mar 26 23:53:42 CEST 2017
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_BookSaveAs(ByRef $oWB, $sFileName, $iFileFormat = $_pmFormatDocument, $sDelimiter = @TAB, $sTextmarker = $_pmImportTextMarkerNone)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oWB) Then Return SetError(1, 1, 0)
If $iFileFormat > 10 And $iFileFormat < 21 Then
$oWB.SaveAs($sFileName, $iFileFormat)
Else
$oWB.SaveAs($sFileName, $iFileFormat, $sDelimiter, $sTextmarker)
EndIf
Return SetError(0, 0, $oWB.Saved)
EndFunc ;==>_PlanMaker_BookSaveAs
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_CellRangeByPosition
; Description ...: Returns a range-string by the position
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_CellRangeByPosition($iStartColumn, $iStartRow, $iEndColumn, $iEndRow)
; Parameter(s): .: $iStartColumn -
; $iStartRow -
; $iEndColumn -
; $iEndRow -
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Tue Mar 28 20:55:05 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_CellRangeByPosition($iStartColumn, $iStartRow, $iEndColumn, $iEndRow)
If Not ($iStartRow > 0 And _
$iStartColumn > 0 And _
$iEndRow > 0 And _
$iEndColumn > 0) Then Return SetError(1, 1, 0)
If Not (IsInt($iStartColumn) And _
IsInt($iStartRow) And _
IsInt($iEndColumn) And _
IsInt($iEndRow)) Then Return SetError(1, 2, 0)
Return SetError(0, 0, _
(__ConvertToLetter($iStartColumn) & $iStartRow & ":" & __ConvertToLetter($iEndColumn) & $iEndRow) _
)
EndFunc ;==>_PlanMaker_CellRangeByPosition
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_CellRead
; Description ...: Reads the value of a cell
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_CellRead(ByRef $oObj[, $iRow = 1[, $iCol = 1]])
; Parameter(s): .: $oPM -
; $iRow - Optional: (Default = 1) :
; $iCol - Optional: (Default = 1) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Fri Jun 16 18:38:13 CEST 2017 @734 /Internet-Zeit/
; Version .......: 0.3
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_CellRead(ByRef $oObj, $iRow = 1, $iCol = 1)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oObj) Then Return SetError(1, 1, "")
Local $vValue = $oObj.ActiveSheet.Cells.Item($iRow, $iCol).Value
Return SetError(0, 0, $vValue)
EndFunc ;==>_PlanMaker_CellRead
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_CellWrite
; Description ...: Writes the value of a cell
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_CellWrite(ByRef $oObj, $vValue[, $iRow = 1[, $iCol = 1]])
; Parameter(s): .: $oPM -
; $vValue -
; $iRow - Optional: (Default = 1) :
; $iCol - Optional: (Default = 1) :
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Mon Mar 27 23:24:39 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_CellWrite(ByRef $oObj, $vValue, $iRow = 1, $iCol = 1)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oObj) Then Return SetError(1, 1, 0)
$oObj.ActiveSheet.Cells.Item($iRow, $iCol).Value = $vValue
Return SetError(0, 0, 1)
EndFunc ;==>_PlanMaker_CellWrite
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_Color2SmoColor
; Description ...: Converts RGB or HEX color to SoftMaker-BGR color
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_RGB2SmoColor($vR, $iG, $iB)
; Parameter(s): .: $vR - red value (or HEX-value e.g. "ff00aa" OR RGB-value e.g. "255,0,128")
; $vG - green value (hex OR int)
; $vB - blue value (hex OR int)
; Return Value ..: Success -
; Failure -
; @ERROR -
; Author(s) .....: Thorsten Willert
; Date ..........: Sun Jun 11 14:57:56 CEST 2017
; Version .......: 1.0
; Example .......: Accepts RGB-values in the following formats
; _PlanMaker_Color2SmoColor("255,0,0")
; _PlanMaker_Color2SmoColor(255,0,0)
; _PlanMaker_Color2SmoColor("FF0000")
; _PlanMaker_Color2SmoColor("FF","00","00")
; ==============================================================================
Func _PlanMaker_Color2SmoColor($vR, $vG = "", $vB = "")
Local $sRet, $a
If $vG = "" And $vB = "" Then
If StringInStr($vR, ",") Then
$a = StringSplit($vR, ",", 2)
If Not @error Then
$vR = $a[0]
$vG = $a[1]
$vB = $a[2]
EndIf
ElseIf StringRegExp($vR, '^[[:xdigit:]]+$') Then
$a = StringRegExp($vR, "^(\w{2})(\w{2})(\w{2})$", 1)
If Not @error Then
$vR = $a[0]
$vG = $a[1]
$vB = $a[2]
EndIf
EndIf
EndIf
If StringRegExp($vR, '^[[:xdigit:]]{2}$') Then
$sRet = $vB & $vG & $vR
ElseIf StringRegExp($vR, '^[[:digit:]]{1,3}$') Then
$sRet = Hex($vB, 2) & Hex($vG, 2) & Hex($vR, 2)
EndIf
Return "&h" & $sRet
EndFunc ;==>_PlanMaker_Color2SmoColor
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_DocumentPropertyGet
; Description ...: Returns a property of the workbook
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_DocumentPropertyGet(ByRef $oObj, $iProperty)
; Parameter(s): .: $oPM -
; $iProperty -
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Mon Mar 27 23:24:23 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_DocumentPropertyGet(ByRef $oObj, $iProperty)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oObj) Then Return SetError(1, 1, 0)
If $oObj.ActiveWorkbook.BuiltInDocumentProperties($iProperty).Valid = True Then
Return SetError(0, 0, $oObj.ActiveWorkbook.BuiltInDocumentProperties($iProperty).Value)
Else
Return SetError(1, 2, 0)
EndIf
EndFunc ;==>_PlanMaker_DocumentPropertyGet
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_DocumentPropertyGetAll
; Description ...: Returns an array of all document properties
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_DocumentPropertyGetAll(ByRef $oPM)
; Parameter(s): .: $oPM -
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Tue Mar 28 14:55:42 CEST 2017
; Version .......: 0.2
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_DocumentPropertyGetAll(ByRef $oPM)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oPM) Then Return SetError(1, 1, 0)
Local $aProperties[23] = [22]
For $i = 1 To 22
If $oPM.BuiltInDocumentProperties($i).Valid = True Then $aProperties[$i] = $oPM.BuiltInDocumentProperties($i).Value
Next
Return SetError(0, 0, $aProperties)
EndFunc ;==>_PlanMaker_DocumentPropertyGetAll
; #FUNCTION# ===================================================================
; Name ..........: _PlanMaker_DocumentPropertySet
; Description ...: Sets an document property
; AutoIt Version : V3.3.14.2
; Syntax ........: _PlanMaker_DocumentPropertySet(ByRef $oPM, $iProperty, $sValue)
; Parameter(s): .: $oPM -
; $iProperty -
; $sValue -
; Return Value ..: Success -
; Failure -
; @ERROR -
; @EXTENDED -
; Author(s) .....: Thorsten Willert
; Date ..........: Tue Mar 28 14:57:49 CEST 2017
; Version .......: 0.3
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _PlanMaker_DocumentPropertySet(ByRef $oPM, $iProperty, $sValue)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oPM) Then Return SetError(1, 1, 0)
If $iProperty < 1 Or $iProperty > 5 Then Return SetError(1, 2, 0)
If $oPM.ActiveWorkbook.BuiltInDocumentProperties($iProperty).Valid = False Then Return SetError(1, 3, 0)
$oPM.ActiveWorkbook.BuiltInDocumentProperties($iProperty).Value = $sValue
Return SetError(0, 0, 1)
EndFunc ;==>_PlanMaker_DocumentPropertySet
Func _PlanMaker_RangeMethode(ByRef $oObj, $vRange, $sMethode)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oObj) Then Return SetError(1, 1, 0)
If Not __IsRange($vRange) Then Return SetError(1, 2, 0)
Local $oRng = (IsObj($vRange) ? $vRange : $oObj.ActiveSheet.Range($vRange))
Local $sKey = StringLower($sMethode)
With $oRng
Switch $sKey
Case "autofit"
.AutoFit
Case "applyformatting"
.ApplyFormatting
Case "select"
.Select
Case "copy"
.Copy
Case "cut"
.Cut
Case "paste"
.Paste
Case "clear"
.Clear
Case "clearcontents"
.ClearContents
Case "clearformats"
.ClearFormats
Case "clearconditionalformatting"
.ClearConditionalFormatting
Case "clearcomments"
.ClearComments
Case "clearinputvalidation"
.ClearInputValidation
Case Else
Return SetError(1, 3, 0)
EndSwitch
EndWith
EndFunc
Func _PlanMaker_RangeFormat(ByRef $oObj, $vRange, $aFormat = Default)
Local $oError = ObjEvent("AutoIt.Error", "__PlanMaker_COMErrFunc")
#forceref $oError
If Not IsObj($oObj) Then Return SetError(1, 1, 0)
If Not __IsRange($vRange) Then Return SetError(1, 2, 0)
Local $oRng, $iEnd, $sKey, $vValue, $iSize = 0
$oRng = (IsObj($vRange) ? $vRange : $oObj.ActiveSheet.Range($vRange))
If Not IsKeyword($aFormat) Then
If Not IsArray($aFormat) Then Return SetError(1, 4, 0)
$iEnd = UBound($aFormat) - 1
With $oRng
For $i = 0 To $iEnd
$sKey = StringLower($aFormat[$i][0])
$vValue = $aFormat[$i][1]
Switch $sKey
Case "name"
.Name = $vValue
Case "horizontalalignment"
.HorizontalAlignment = $vValue
Case "verticalalignment"
.VerticalAlignment = $vValue
Case "WrapText"
.wraptext = $vValue
Case "leftpadding"
.LeftPadding = $vValue
Case "rightpadding"
.RightPadding = $vValue
Case "toppadding"
.TopPadding = $vValue
Case "bottompadding"
.BottomPadding = $vValue
Case "mergecells"
.MergeCells = $vValue
Case "orientation"
.Orientation = $vValue
Case "verticaltext"
.VerticalText = $vValue
Case "pagebreakcol"
.PageBreakCol = $vValue
Case "pagebreakrow"
.PageBreakRow = $vValue
Case "comment"
.Comment = $vValue
Case "locked"
.Locked = $vValue
Case "formulahidden"
.FormulaHidden = $vValue
Case "cellhidden"
.CellHidden = $vValue
Case "nonprintable"
.Nonprintable = $vValue
Case "hidden"
.Hidden = $vValue
Case "rowheight"
.RowHeight = $vValue
Case "columnwidth"
.ColumnWidth = $vValue
EndSwitch
Next
EndWith
EndIf
EndFunc
; #FUNCTION# ===================================================================