2 Begin VB.Form frmWizard
\r
4 BackColor = &H80000005&
\r
5 BorderStyle = 1 'Fixed Single
\r
6 Caption = "OpenOffice.org Document Analysis Wizard"
\r
16 Underline = 0 'False
\r
18 Strikethrough = 0 'False
\r
20 Icon = "Wizard.frx":0000
\r
21 KeyPreview = -1 'True
\r
23 LockControls = -1 'True
\r
24 MaxButton = 0 'False
\r
25 MinButton = 0 'False
\r
29 Begin VB.Frame fraStep
\r
30 BorderStyle = 0 'None
\r
31 Caption = "Introduction"
\r
32 ClipControls = 0 'False
\r
35 Name = "MS Sans Serif"
\r
39 Underline = 0 'False
\r
41 Strikethrough = 0 'False
\r
50 Begin VB.PictureBox Picture4
\r
51 Appearance = 0 'Flat
\r
52 BackColor = &H80000005&
\r
53 BorderStyle = 0 'None
\r
54 ForeColor = &H80000008&
\r
64 Begin VB.PictureBox Picture10
\r
74 Begin VB.PictureBox Picture6
\r
75 Appearance = 0 'Flat
\r
76 BackColor = &H80000005&
\r
77 BorderStyle = 0 'None
\r
78 ForeColor = &H80000008&
\r
87 Begin VB.PictureBox Picture1
\r
88 Appearance = 0 'Flat
\r
89 BackColor = &H80000005&
\r
90 BorderStyle = 0 'None
\r
91 ForeColor = &H80000008&
\r
95 Picture = "Wizard.frx":482C2
\r
105 Begin VB.Label lblStep1_4
\r
106 BackColor = &H00EED3C2&
\r
107 BackStyle = 0 'Transparent
\r
108 Caption = "4. Analyze"
\r
109 ForeColor = &H00BF4F59&
\r
117 Begin VB.Line Line2
\r
118 BorderColor = &H00808080&
\r
125 Begin VB.Line Line3
\r
132 Begin VB.Label Label7
\r
133 BackColor = &H00EED3C2&
\r
134 Caption = "1. Introduction"
\r
135 ForeColor = &H00BF4F59&
\r
144 Begin VB.Label Label8
\r
145 BackColor = &H00EED3C2&
\r
146 BackStyle = 0 'Transparent
\r
147 Caption = "3. Results"
\r
148 ForeColor = &H00BF4F59&
\r
157 Begin VB.Label Label9
\r
158 BackColor = &H00EED3C2&
\r
159 BackStyle = 0 'Transparent
\r
160 Caption = "2. Documents"
\r
161 ForeColor = &H00BF4F59&
\r
170 Begin VB.Label Label12
\r
171 BackStyle = 0 'Transparent
\r
173 BeginProperty Font
\r
178 Underline = 0 'False
\r
180 Strikethrough = 0 'False
\r
191 Begin VB.PictureBox Picture8
\r
192 Appearance = 0 'Flat
\r
193 BorderStyle = 0 'None
\r
194 ForeColor = &H80000008&
\r
203 Begin VB.CheckBox chkShowIntro
\r
204 Caption = "Do not show this introduction again"
\r
208 MaskColor = &H00000000&
\r
215 Begin VB.Label lblIntroduction1
\r
216 AutoSize = -1 'True
\r
217 Caption = $"Wizard.frx":4F8B8
\r
224 WordWrap = -1 'True
\r
226 Begin VB.Label lblIntroduction3
\r
227 AutoSize = -1 'True
\r
228 Caption = "The wizard will remain on screen while the analysis is carried out."
\r
235 WordWrap = -1 'True
\r
237 Begin VB.Label lblIntroduction2
\r
238 AutoSize = -1 'True
\r
239 Caption = "You will be able to select which documents you want to analyze as well as where you want the results to the analysis to be saved. "
\r
246 WordWrap = -1 'True
\r
248 Begin VB.Label Label12
\r
249 BackStyle = 0 'Transparent
\r
250 Caption = "Introduction"
\r
251 BeginProperty Font
\r
256 Underline = 0 'False
\r
258 Strikethrough = 0 'False
\r
270 Begin VB.Frame fraStep
\r
271 BorderStyle = 0 'None
\r
274 BeginProperty Font
\r
275 Name = "MS Sans Serif"
\r
279 Underline = 0 'False
\r
281 Strikethrough = 0 'False
\r
290 Begin VB.PictureBox Picture4
\r
291 Appearance = 0 'Flat
\r
292 BackColor = &H80000005&
\r
293 BorderStyle = 0 'None
\r
294 ForeColor = &H80000008&
\r
304 Begin VB.PictureBox Picture1
\r
305 Appearance = 0 'Flat
\r
306 BackColor = &H80000005&
\r
307 BorderStyle = 0 'None
\r
308 ForeColor = &H80000008&
\r
312 Picture = "Wizard.frx":4F971
\r
321 Begin VB.Label lblStep2_4
\r
322 BackColor = &H00EED3C2&
\r
323 BackStyle = 0 'Transparent
\r
324 Caption = "4. Analyze"
\r
325 ForeColor = &H00BF4F59&
\r
333 Begin VB.Line Line2
\r
334 BorderColor = &H00808080&
\r
341 Begin VB.Label Label12
\r
342 BackStyle = 0 'Transparent
\r
344 BeginProperty Font
\r
349 Underline = 0 'False
\r
351 Strikethrough = 0 'False
\r
361 Begin VB.Label Label9
\r
362 BackColor = &H00EED3C2&
\r
363 Caption = "2. Documents"
\r
364 ForeColor = &H00BF4F59&
\r
373 Begin VB.Label Label8
\r
374 BackColor = &H00EED3C2&
\r
375 BackStyle = 0 'Transparent
\r
376 Caption = "3. Results"
\r
377 ForeColor = &H00BF4F59&
\r
386 Begin VB.Label Label7
\r
387 BackColor = &H00EED3C2&
\r
388 BackStyle = 0 'Transparent
\r
389 Caption = "1. Introduction"
\r
390 ForeColor = &H00BF4F59&
\r
399 Begin VB.Line Line3
\r
407 Begin VB.PictureBox Picture7
\r
408 Appearance = 0 'Flat
\r
409 BorderStyle = 0 'None
\r
410 ForeColor = &H80000008&
\r
419 Begin VB.ComboBox cbIgnoreOld
\r
421 ItemData = "Wizard.frx":56F67
\r
423 List = "Wizard.frx":56F74
\r
424 Style = 2 'Dropdown List
\r
429 Begin VB.CheckBox chkIgnoreOld
\r
430 Caption = "Ignore documents older than"
\r
437 Begin VB.CheckBox chkWordDoc
\r
438 Caption = "Documents (*.doc)"
\r
447 Begin VB.CheckBox chkWordTemplate
\r
448 Caption = "Templates (*.dot)"
\r
456 Begin VB.CheckBox chkPPTemplate
\r
457 Caption = "Templates (*.pot)"
\r
465 Begin VB.CheckBox chkPPDoc
\r
466 Caption = "Presentations (*.ppt)"
\r
474 Begin VB.CheckBox chkExcelDoc
\r
475 Caption = "Spreadsheets (*.xls)"
\r
483 Begin VB.CheckBox chkExcelTemplate
\r
484 Caption = "Templates (*.xlt)"
\r
492 Begin VB.CommandButton btnBrowseDirInput
\r
500 Begin VB.TextBox txtInputDir
\r
509 Begin VB.CheckBox chkIncludeSubdirs
\r
510 Caption = "Include subdirectories in the analysis"
\r
518 Begin VB.Label lblDocTypes
\r
519 Caption = "Document types to analyze"
\r
527 Begin VB.Label lblChooseDocs
\r
528 AutoSize = -1 'True
\r
529 Caption = "Choose the documents you want to analyze"
\r
530 BeginProperty Font
\r
535 Underline = 0 'False
\r
537 Strikethrough = 0 'False
\r
545 WordWrap = -1 'True
\r
547 Begin VB.Label Label13
\r
548 AutoSize = -1 'True
\r
549 Caption = "PowerPoint"
\r
557 WordWrap = -1 'True
\r
559 Begin VB.Label Label13
\r
560 AutoSize = -1 'True
\r
569 WordWrap = -1 'True
\r
571 Begin VB.Label Label13
\r
572 AutoSize = -1 'True
\r
581 WordWrap = -1 'True
\r
583 Begin VB.Label Label1
\r
584 Caption = "Location of Microsoft Office documents"
\r
594 Begin VB.Frame fraStep
\r
595 BorderStyle = 0 'None
\r
596 Caption = "Options"
\r
598 BeginProperty Font
\r
599 Name = "MS Sans Serif"
\r
603 Underline = 0 'False
\r
605 Strikethrough = 0 'False
\r
614 Begin VB.PictureBox Picture11
\r
615 BorderStyle = 0 'None
\r
623 Begin VB.CommandButton btnBrowseDirOut
\r
632 Begin VB.TextBox txtResultsName
\r
637 Text = "Analysis Results.xls"
\r
641 Begin VB.TextBox txtOutputDir
\r
648 Begin VB.PictureBox Picture5
\r
649 Appearance = 0 'Flat
\r
650 BorderStyle = 0 'None
\r
651 ForeColor = &H80000008&
\r
660 Begin VB.OptionButton rdbResultsPrompt
\r
661 Caption = "Ask me before overwriting"
\r
670 Begin VB.OptionButton rdbResultsOverwrite
\r
671 Caption = "Overwrite without asking me"
\r
679 Begin VB.OptionButton rdbResultsAppend
\r
680 Caption = "Append the new results to the existing results"
\r
690 Begin VB.Frame Frame3
\r
691 Appearance = 0 'Flat
\r
692 BackColor = &H80000005&
\r
693 BorderStyle = 0 'None
\r
695 ForeColor = &H0099A8AC&
\r
702 Begin VB.PictureBox Picture1
\r
703 Appearance = 0 'Flat
\r
704 BackColor = &H80000005&
\r
705 BorderStyle = 0 'None
\r
706 ForeColor = &H80000008&
\r
710 Picture = "Wizard.frx":56F97
\r
718 Begin VB.Label lblStep3_4
\r
719 BackColor = &H00EED3C2&
\r
720 BackStyle = 0 'Transparent
\r
721 Caption = "4. Analyze"
\r
722 ForeColor = &H00BF4F59&
\r
730 Begin VB.Label Label12
\r
731 BackStyle = 0 'Transparent
\r
733 BeginProperty Font
\r
738 Underline = 0 'False
\r
740 Strikethrough = 0 'False
\r
750 Begin VB.Label Label9
\r
751 BackColor = &H00EED3C2&
\r
752 BackStyle = 0 'Transparent
\r
753 Caption = "2. Documents"
\r
754 ForeColor = &H00BF4F59&
\r
763 Begin VB.Label Label8
\r
764 BackColor = &H00EED3C2&
\r
765 Caption = "3. Results"
\r
766 ForeColor = &H00BF4F59&
\r
775 Begin VB.Label Label7
\r
776 BackColor = &H00EED3C2&
\r
777 BackStyle = 0 'Transparent
\r
778 Caption = "1. Introduction"
\r
779 ForeColor = &H00BF4F59&
\r
788 Begin VB.Line Line3
\r
796 Begin VB.Label Label3
\r
797 Caption = "File name for the results spreadsheet"
\r
805 Begin VB.Label lblResultsLocation
\r
806 Caption = "Location"
\r
814 Begin VB.Label Label13
\r
815 AutoSize = -1 'True
\r
816 Caption = "If results already exisit under the same name and location:"
\r
824 WordWrap = -1 'True
\r
826 Begin VB.Line Line2
\r
827 BorderColor = &H00808080&
\r
834 Begin VB.Label lblChooseResults
\r
835 AutoSize = -1 'True
\r
836 Caption = "Choose where and how to save the analysis results"
\r
837 BeginProperty Font
\r
842 Underline = 0 'False
\r
844 Strikethrough = 0 'False
\r
852 WordWrap = -1 'True
\r
855 Begin VB.Frame fraStep
\r
856 BorderStyle = 0 'None
\r
857 Caption = "Analyze"
\r
859 BeginProperty Font
\r
860 Name = "MS Sans Serif"
\r
864 Underline = 0 'False
\r
866 Strikethrough = 0 'False
\r
875 Begin VB.PictureBox Picture12
\r
876 Appearance = 0 'Flat
\r
877 BorderStyle = 0 'None
\r
878 ForeColor = &H80000008&
\r
888 Begin VB.CommandButton btnPrepare
\r
889 Caption = "Prepare"
\r
899 Begin VB.CommandButton btnRunAnalysis
\r
908 Begin VB.CommandButton btnViewResults
\r
918 Begin VB.Frame Frame3
\r
919 Appearance = 0 'Flat
\r
920 BackColor = &H80000005&
\r
921 BorderStyle = 0 'None
\r
923 ForeColor = &H0099A8AC&
\r
930 Begin VB.PictureBox Picture4
\r
931 Appearance = 0 'Flat
\r
932 BackColor = &H80000005&
\r
933 BorderStyle = 0 'None
\r
934 ForeColor = &H80000008&
\r
944 Begin VB.PictureBox Picture1
\r
945 Appearance = 0 'Flat
\r
946 BackColor = &H80000005&
\r
947 BorderStyle = 0 'None
\r
948 ForeColor = &H80000008&
\r
952 Picture = "Wizard.frx":5E58D
\r
962 Begin VB.Label lblStep4_4
\r
963 BackColor = &H00EED3C2&
\r
964 Caption = "4. Analyze"
\r
965 ForeColor = &H00BF4F59&
\r
973 Begin VB.Label Label12
\r
974 BackStyle = 0 'Transparent
\r
976 BeginProperty Font
\r
981 Underline = 0 'False
\r
983 Strikethrough = 0 'False
\r
993 Begin VB.Label Label9
\r
994 BackColor = &H00EED3C2&
\r
995 BackStyle = 0 'Transparent
\r
996 Caption = "2. Documents"
\r
997 ForeColor = &H00BF4F59&
\r
1006 Begin VB.Label Label8
\r
1007 BackColor = &H00EED3C2&
\r
1008 BackStyle = 0 'Transparent
\r
1009 Caption = "3. Results"
\r
1010 ForeColor = &H00BF4F59&
\r
1019 Begin VB.Label Label7
\r
1020 BackColor = &H00EED3C2&
\r
1021 BackStyle = 0 'Transparent
\r
1022 Caption = "1. Introduction"
\r
1023 ForeColor = &H00BF4F59&
\r
1032 Begin VB.Line Line3
\r
1040 Begin VB.Label lblSkippedOld
\r
1041 Caption = "Skipped <TOPIC> documets, because they were too old"
\r
1048 Begin VB.Label lblSetupDone
\r
1049 AutoSize = -1 'True
\r
1050 Caption = "Run the analysis and view the results"
\r
1051 BeginProperty Font
\r
1056 Underline = 0 'False
\r
1058 Strikethrough = 0 'False
\r
1066 WordWrap = -1 'True
\r
1068 Begin VB.Label lblNumPPT
\r
1069 Caption = "<TOPIC> Presentations"
\r
1077 Begin VB.Label lblNumPOT
\r
1078 Caption = "<TOPIC> Templates"
\r
1086 Begin VB.Label lblNumXLS
\r
1087 Caption = "<TOPIC> Spreadsheets"
\r
1095 Begin VB.Label lblNumXLT
\r
1096 Caption = "<TOPIC> Templates"
\r
1104 Begin VB.Label Label16
\r
1105 AutoSize = -1 'True
\r
1106 Caption = "PowerPoint"
\r
1113 WordWrap = -1 'True
\r
1115 Begin VB.Label Label13
\r
1125 Begin VB.Label Label13
\r
1135 Begin VB.Label Label13
\r
1136 Caption = "PowerPoint"
\r
1145 Begin VB.Label Label13
\r
1155 Begin VB.Label Label13
\r
1165 Begin VB.Label Label13
\r
1166 Caption = "PowerPoint"
\r
1175 Begin VB.Label lblNumTemplates
\r
1176 Caption = "<TOPIC> Templates"
\r
1184 Begin VB.Label lblNumDocs
\r
1185 Caption = "<TOPIC> Documents"
\r
1193 Begin VB.Line Line6
\r
1194 BorderColor = &H00808080&
\r
1200 Begin VB.Label Label15
\r
1201 AutoSize = -1 'True
\r
1209 WordWrap = -1 'True
\r
1211 Begin VB.Label Label14
\r
1212 AutoSize = -1 'True
\r
1220 WordWrap = -1 'True
\r
1222 Begin VB.Label lblTotalNumDocs
\r
1223 AutoSize = -1 'True
\r
1224 Caption = "A total of <TOPIC> documents will be analyzed:"
\r
1231 WordWrap = -1 'True
\r
1233 Begin VB.Line Line2
\r
1234 BorderColor = &H00808080&
\r
1242 Begin VB.PictureBox picNav
\r
1243 Align = 2 'Align Bottom
\r
1244 Appearance = 0 'Flat
\r
1245 BorderStyle = 0 'None
\r
1246 BeginProperty Font
\r
1247 Name = "MS Sans Serif"
\r
1251 Underline = 0 'False
\r
1253 Strikethrough = 0 'False
\r
1255 ForeColor = &H80000008&
\r
1261 TabStop = 0 'False
\r
1264 Begin VB.CommandButton cmdNav
\r
1265 Caption = "Finish"
\r
1269 MaskColor = &H00000000&
\r
1275 Begin VB.CommandButton cmdNav
\r
1276 Caption = "Next >>"
\r
1280 MaskColor = &H00000000&
\r
1286 Begin VB.CommandButton cmdNav
\r
1287 Caption = "<< Back"
\r
1291 MaskColor = &H00000000&
\r
1297 Begin VB.CommandButton cmdNav
\r
1299 Caption = "Cancel"
\r
1303 MaskColor = &H00000000&
\r
1310 Begin VB.Label Label18
\r
1311 Caption = "<TOPIC> Documents"
\r
1317 WordWrap = -1 'True
\r
1319 Begin VB.Label Label17
\r
1320 Caption = "<TOPIC> Templates"
\r
1326 WordWrap = -1 'True
\r
1328 Begin VB.Line Line4
\r
1329 BorderColor = &H00808080&
\r
1336 Attribute VB_Name = "frmWizard"
\r
1337 Attribute VB_GlobalNameSpace = False
\r
1338 Attribute VB_Creatable = False
\r
1339 Attribute VB_PredeclaredId = True
\r
1340 Attribute VB_Exposed = False
\r
1341 ' *******************************************************************************
\r
1342 ' * $RCSfile: Wizard.frm,v $
\r
1346 ' * Last change: $Date: 2008/10/07 11:35:55 $ $Revision: 1.42.66.2 $
\r
1348 ' * Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use of this
\r
1349 ' * product is subject to license terms.
\r
1351 ' *******************************************************************************
\r
1355 Const TOPIC_STR = "<TOPIC>"
\r
1356 Const TOPIC2_STR = "<TOPIC2>"
\r
1357 Const CR_STR = "<CR>"
\r
1358 Const CDEBUG_LEVEL_DEFAULT = 1 'Will output all Debug output to analysis.log file
\r
1359 Const CSUPPORTED_VERSION = 9#
\r
1361 Const NUM_STEPS = 4
\r
1363 Const CAPPNAME_WORD = "Word"
\r
1364 Const CAPPNAME_EXCEL = "Excel"
\r
1365 Const CAPPNAME_POWERPOINT = "PowerPoint"
\r
1366 Const CANALYZING = "Analyzing"
\r
1368 Const BTN_CANCEL = 1
\r
1369 Const BTN_BACK = 2
\r
1370 Const BTN_NEXT = 3
\r
1371 Const BTN_FINISH = 4
\r
1373 Const STEP_INTRO = 0
\r
1376 Const STEP_FINISH = 3
\r
1378 Const DIR_NONE = 0
\r
1379 Const DIR_BACK = 1
\r
1380 Const DIR_NEXT = 2
\r
1382 Const CPRODUCTNAME_STR = "<PRODUCTNAME>"
\r
1384 Const CSTR_ANALYSIS_LOG_DONE = "Done"
\r
1386 Const CINPUT_DIR = "indir"
\r
1387 Const COUTPUT_DIR = "outdir"
\r
1388 Const CRESULTS_FILE = "resultsfile"
\r
1389 Const CLOG_FILE = "logfile"
\r
1390 Const CRESULTS_TEMPLATE = "resultstemplate"
\r
1391 Const CRESULTS_EXIST = "resultsexist"
\r
1392 Const CPROMPT_FILE = "promptfile"
\r
1393 Const COVERWRITE_FILE = "overwritefile"
\r
1394 Const CAPPEND_FILE = "appendfile"
\r
1395 Const CNEW_RESULTS_FILE = "newresultsfile"
\r
1396 Const CINCLUDE_SUBDIRS = "includesubdirs"
\r
1397 Const CDEBUG_LEVEL = "debuglevel"
\r
1398 Const CTYPE_WORDDOC = "typeworddoc"
\r
1399 Const CTYPE_WORDDOT = "typeworddot"
\r
1400 Const CTYPE_EXCELDOC = "typeexceldoc"
\r
1401 Const CTYPE_EXCELDOT = "typeexceldot"
\r
1402 Const CTYPE_PPDOC = "typepowerpointdoc"
\r
1403 Const CTYPE_PPDOT = "typepowerpointdot"
\r
1404 Const COUTPUT_TYPE = "outputtype"
\r
1405 Const COUTPUT_TYPE_XLS = "xls"
\r
1406 Const COUTPUT_TYPE_XML = "xml"
\r
1407 Const COUTPUT_TYPE_BOTH = "both"
\r
1408 Const CVERSION = "version"
\r
1409 Const CDOPREPARE = "prepare"
\r
1410 Const CTITLE = "title"
\r
1411 Const CIGNORE_OLD_DOCS = "ignoreolddocuments"
\r
1412 Const CISSUE_LIMIT = "issuesmonthlimit"
\r
1413 Const CISSUE_LIMIT_DAW = 6
\r
1414 Private mIssueLimit As Integer
\r
1415 Const CDEFAULT_PASSWORD = "defaultpassword"
\r
1416 Const CSTR_TEST_PASSWORD = "test"
\r
1417 Private mDefaultPassword As String
\r
1419 Const CLAST_CHECKPOINT As String = "LastCheckpoint"
\r
1420 Const CNEXT_FILE As String = "NextFile"
\r
1421 Const C_ABORT_ANALYSIS As String = "AbortAnalysis"
\r
1423 Const CNUMBER_TOTAL_DOCS = "total_numberdocs"
\r
1424 Const CNUMBER_DOCS_DOC = "numberdocs_doc"
\r
1425 Const CNUMBER_TEMPLATES_DOT = "numbertemplates_dot"
\r
1426 Const CNUMBER_DOCS_XLS = "numberdocs_xls"
\r
1427 Const CNUMBER_TEMPLATES_XLT = "numbertemplates_xlt"
\r
1428 Const CNUMBER_DOCS_PPT = "numberdocs_ppt"
\r
1429 Const CNUMBER_TEMPLATES_POT = "numbertemplates_pot"
\r
1430 Const CSTART_TIME = "start"
\r
1431 Const CEND_TIME = "end"
\r
1432 Const CELAPSED_TIME = "time_for_analysis"
\r
1433 Const CWINVERSION = "win_version"
\r
1434 Const CUSER_LOCALE_INFO = "user_locale"
\r
1435 Const CSYS_LOCALE_INFO = "system_locale"
\r
1436 Const CWORD_VERSION = "word_ver"
\r
1437 Const CEXCEL_VERSION = "excel_ver"
\r
1438 Const CPOWERPOINT_VERSION = "powerpoint_ver"
\r
1439 Const CNOT_INSTALLED = "not installed"
\r
1441 Const CRESULTS_FILE_EXTENSION = ".xls"
\r
1442 Const CCONFIG_BACKUP_EXT = "_bak"
\r
1443 Const CDEFAULT_README_NAME = "UserGuide"
\r
1445 Const C_DOCS_LESS_3_MONTH = "DocumentsYoungerThan3Month"
\r
1446 Const C_DOCS_LESS_6_MONTH = "DocumentsYoungerThan6Month"
\r
1447 Const C_DOCS_LESS_12_MONTH = "DocumentsYoungerThan12Month"
\r
1448 Const C_DOCS_MORE_12_MONTH = "DocumentsOlderThan12Month"
\r
1450 'module level vars
\r
1451 Dim mnCurStep As Integer
\r
1452 Dim mbTrue As Boolean
\r
1453 Dim mbFalse As Boolean
\r
1454 Dim mLblSteps As String
\r
1455 Dim mChbSubdirs As String
\r
1457 Dim mWordDocCount As Long
\r
1458 Dim mExcelDocCount As Long
\r
1459 Dim mPPDocCount As Long
\r
1461 Dim mWordTemplateCount As Long
\r
1462 Dim mExcelTemplateCount As Long
\r
1463 Dim mPPTemplateCount As Long
\r
1464 Dim mTotalDocCount As Long
\r
1465 Dim mIgnoredDocCount As Long
\r
1467 Public VBInst As VBIDE.VBE
\r
1468 Dim mbFinishOK As Boolean
\r
1469 Dim mbAllowExit As Boolean
\r
1470 Private mStrTrue As String
\r
1471 Private mLogFilePath As String
\r
1472 Private mDebugLevel As String
\r
1473 Private mIniFilePath As String
\r
1474 Private mbDocCountCurrent As Boolean
\r
1475 Private mbDoPrepare As Boolean
\r
1477 Dim mDocFiles As CollectedFiles
\r
1479 Private Declare Sub InitCommonControls Lib "comctl32" ()
\r
1480 Private Declare Function GetTickCount Lib "kernel32" () As Long
\r
1481 Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
\r
1483 Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
\r
1485 Private Declare Function FormatMessage Lib "kernel32" Alias _
\r
1486 "FormatMessageA" (ByVal dwFlags As Long, lpSource As Long, _
\r
1487 ByVal dwMessageId As Long, ByVal dwLanguageId As Long, _
\r
1488 ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Any) As Long
\r
1491 Private Const HKEY_CURRENT_USER As Long = &H80000001
\r
1492 Private Const HKEY_LOCAL_MACHINE As Long = &H80000002
\r
1494 Const WORD_APP = "word"
\r
1495 Const EXCEL_APP = "excel"
\r
1496 Const PP_APP = "pp"
\r
1497 Const REG_KEY_APP_PATH = "Software\Microsoft\Windows\CurrentVersion\App Paths\"
\r
1500 Function GetAppPath(myApp As String) As String
\r
1501 Dim myPath As String
\r
1503 If (myApp = WORD_APP) Then
\r
1504 myPath = GetRegistryInfo(HKEY_LOCAL_MACHINE, REG_KEY_APP_PATH & "winword.exe", "")
\r
1505 ElseIf (myApp = EXCEL_APP) Then
\r
1506 myPath = GetRegistryInfo(HKEY_LOCAL_MACHINE, REG_KEY_APP_PATH & "excel.exe", "")
\r
1507 ElseIf (myApp = PP_APP) Then
\r
1508 myPath = GetRegistryInfo(HKEY_LOCAL_MACHINE, REG_KEY_APP_PATH & "powerpnt.exe", "")
\r
1510 MsgBox "Unknown application: " & myApp, vbCritical
\r
1514 If (myPath = "") Then
\r
1515 If (myApp = WORD_APP) Then
\r
1516 myPath = GetRegistryInfo(HKEY_CURRENT_USER, REG_KEY_APP_PATH & "winword.exe", "")
\r
1517 ElseIf (myApp = EXCEL_APP) Then
\r
1518 myPath = GetRegistryInfo(HKEY_CURRENT_USER, REG_KEY_APP_PATH & "excel.exe", "")
\r
1519 ElseIf (myApp = PP_APP) Then
\r
1520 myPath = GetRegistryInfo(HKEY_CURRENT_USER, REG_KEY_APP_PATH & "powerpnt.exe", "")
\r
1524 GetAppPath = myPath
\r
1527 Function GetDriverDoc(myApp As String) As String
\r
1528 Dim myPath As String
\r
1529 Dim errStr As String
\r
1530 Dim fso As New FileSystemObject
\r
1532 If (myApp = WORD_APP) Then
\r
1533 myPath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CWORD_DRIVER_FILE)
\r
1534 ElseIf (myApp = EXCEL_APP) Then
\r
1535 myPath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CEXCEL_DRIVER_FILE)
\r
1536 ElseIf (myApp = PP_APP) Then
\r
1537 myPath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CPP_DRIVER_FILE)
\r
1539 MsgBox "Unknown application: " & myApp, vbCritical
\r
1543 If Not fso.FileExists(myPath) Then
\r
1544 errStr = ReplaceTopic2Tokens(GetResString(ERR_MISSING_WORD_DRIVER), _
\r
1545 TOPIC_STR, myPath, CR_STR, Chr(13))
\r
1547 MsgBox errStr, vbCritical
\r
1551 GetDriverDoc = myPath
\r
1560 Private Function AutomationMessageText(lCode As Long) As String
\r
1561 Dim sRtrnCode As String
\r
1564 sRtrnCode = Space$(256)
\r
1565 lRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0&, lCode, 0&, _
\r
1566 sRtrnCode, 256&, 0&)
\r
1568 AutomationMessageText = Left(sRtrnCode, lRet)
\r
1570 AutomationMessageText = "Error not found."
\r
1575 Private Sub btnBrowseDirInput_Click()
\r
1576 Dim folder As String
\r
1577 Dim StartDir As String
\r
1579 If Len(txtInputDir.Text) > 0 Then
\r
1580 StartDir = txtInputDir.Text
\r
1583 folder = BrowseForFolder(Me, GetResString(BROWSE_FOR_DOC_DIR_ID), StartDir)
\r
1584 If Len(folder) = 0 Then
\r
1585 Exit Sub 'User Selected Cancel
\r
1587 txtInputDir.Text = folder
\r
1588 txtInputDir.ToolTipText = folder
\r
1590 If Len(txtOutputDir.Text) = 0 Then
\r
1591 txtOutputDir.Text = folder
\r
1592 txtOutputDir.ToolTipText = folder
\r
1596 Private Sub btnBrowseDirOut_Click()
\r
1597 Dim folder As String
\r
1598 Dim StartDir As String
\r
1600 If Len(txtOutputDir.Text) > 0 Then
\r
1601 StartDir = txtOutputDir.Text
\r
1604 folder = BrowseForFolder(Me, GetResString(BROWSE_FOR_RES_DIR_ID), StartDir)
\r
1605 If Len(folder) = 0 Then
\r
1606 Exit Sub 'User Selected Cancel
\r
1608 txtOutputDir.Text = folder
\r
1609 txtOutputDir.ToolTipText = folder
\r
1612 Private Sub btnPrepare_Click()
\r
1613 On Error GoTo HandleErrors
\r
1614 Dim currentFunctionName As String
\r
1615 currentFunctionName = "btnPrepare_Click"
\r
1617 mbDoPrepare = True
\r
1618 mbAllowExit = True
\r
1620 btnViewResults.Enabled = False
\r
1621 btnRunAnalysis.Enabled = False
\r
1622 btnPrepare.Enabled = False
\r
1624 cmdNav(BTN_CANCEL).Enabled = False
\r
1625 cmdNav(BTN_BACK).Enabled = False
\r
1626 cmdNav(BTN_NEXT).Enabled = False
\r
1627 cmdNav(BTN_FINISH).Enabled = False
\r
1628 btnPrepare.Caption = GetResString(RUNBTN_RUNNING_ID)
\r
1632 If RunAnalysis(True) Then
\r
1633 cmdNav(BTN_FINISH).Enabled = True
\r
1634 btnRunAnalysis.Enabled = True
\r
1635 btnViewResults.Enabled = True
\r
1636 btnPrepare.Enabled = True
\r
1637 btnViewResults.SetFocus
\r
1638 str = ReplaceTopic2Tokens(GetResString(RID_STR_ENG_OTHER_PREPARE_COMPLETED_PREP_ID), _
\r
1639 TOPIC_STR, getOutputDir, CR_STR, Chr(13))
\r
1640 MsgBox str, vbInformation
\r
1642 cmdNav(BTN_FINISH).Enabled = False
\r
1643 btnRunAnalysis.Enabled = True
\r
1644 btnViewResults.Enabled = False
\r
1645 btnPrepare.Enabled = False
\r
1649 mbDoPrepare = False
\r
1650 cmdNav(BTN_CANCEL).Enabled = True
\r
1651 cmdNav(BTN_BACK).Enabled = True
\r
1652 cmdNav(BTN_NEXT).Enabled = False
\r
1653 btnPrepare.Caption = GetResString(PREPAREBTN_START_ID)
\r
1657 cmdNav(BTN_FINISH).Enabled = False
\r
1658 btnRunAnalysis.Enabled = True
\r
1659 btnViewResults.Enabled = False
\r
1660 btnPrepare.Enabled = False
\r
1662 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
1667 Private Sub cmdNav_Click(Index As Integer)
\r
1668 On Error GoTo HandleError
\r
1669 Dim currentFunctionName As String
\r
1670 currentFunctionName = "cmdNav_Click"
\r
1671 Dim nAltStep As Integer
\r
1673 Dim fso As Scripting.FileSystemObject
\r
1677 'Copy backup configuration file over existing
\r
1678 If fso Is Nothing Then
\r
1679 Set fso = New Scripting.FileSystemObject
\r
1681 If fso.FileExists(mIniFilePath & CCONFIG_BACKUP_EXT) Then
\r
1682 DeleteFile mIniFilePath
\r
1683 AttemptToCopyFile mIniFilePath & CCONFIG_BACKUP_EXT, mIniFilePath
\r
1685 Set mDocFiles = Nothing
\r
1690 nAltStep = mnCurStep - 1
\r
1691 SetStep nAltStep, DIR_BACK
\r
1694 nAltStep = mnCurStep + 1
\r
1695 SetStep nAltStep, DIR_NEXT
\r
1698 If (Not mbAllowExit) Then
\r
1700 Dim response As Integer
\r
1702 str = ReplaceTopicTokens(GetResString(RID_STR_ENG_ANALYSE_NOT_RUN), CR_STR, Chr(13))
\r
1703 response = MsgBox(str, vbOKCancel + vbInformation)
\r
1704 If response = vbOK Then ' User chose Ok.
\r
1705 mbAllowExit = True
\r
1709 If (mbAllowExit) Then
\r
1710 DeleteFile mIniFilePath & CCONFIG_BACKUP_EXT
\r
1711 Set mDocFiles = Nothing
\r
1721 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
1726 Private Sub btnRunAnalysis_Click()
\r
1727 On Error GoTo HandleErrors
\r
1728 Dim bViewResults As Boolean
\r
1730 Dim response As Integer
\r
1732 btnViewResults.Enabled = False
\r
1733 btnRunAnalysis.Enabled = False
\r
1734 btnPrepare.Enabled = False
\r
1735 bViewResults = False
\r
1736 mbAllowExit = True
\r
1738 cmdNav(BTN_CANCEL).Enabled = False
\r
1739 cmdNav(BTN_BACK).Enabled = False
\r
1740 cmdNav(BTN_NEXT).Enabled = False
\r
1741 cmdNav(BTN_FINISH).Enabled = False
\r
1742 btnRunAnalysis.Caption = GetResString(RUNBTN_RUNNING_ID)
\r
1744 If RunAnalysis(False) Then
\r
1745 cmdNav(BTN_FINISH).Enabled = True
\r
1746 btnRunAnalysis.Enabled = True
\r
1747 btnViewResults.Enabled = True
\r
1748 btnPrepare.Enabled = True
\r
1749 btnViewResults.SetFocus
\r
1750 btnRunAnalysis.Caption = GetResString(RUNBTN_START_ID)
\r
1752 str = ReplaceTopicTokens(GetResString(RID_STR_ENG_ANALYZE_COMPLETED_ID), CR_STR, Chr(13))
\r
1753 response = MsgBox(str, vbOKCancel + vbInformation)
\r
1754 If response = vbOK Then ' User chose Ok.
\r
1755 bViewResults = True
\r
1758 btnRunAnalysis.Enabled = True
\r
1759 btnViewResults.Enabled = False
\r
1760 btnPrepare.Enabled = False
\r
1764 cmdNav(BTN_CANCEL).Enabled = True
\r
1765 cmdNav(BTN_BACK).Enabled = True
\r
1766 cmdNav(BTN_NEXT).Enabled = False
\r
1767 btnRunAnalysis.Caption = GetResString(RUNBTN_START_ID)
\r
1769 If bViewResults Then
\r
1770 btnViewResults_Click
\r
1776 cmdNav(BTN_FINISH).Enabled = False
\r
1777 btnRunAnalysis.Enabled = True
\r
1778 btnViewResults.Enabled = False
\r
1779 btnPrepare.Enabled = False
\r
1780 WriteDebug "Document Analysis: View Analysis Results" & Err.Number & " " & Err.Description & " " & Err.Source
\r
1784 Private Sub btnViewResults_Click()
\r
1785 On Error GoTo HandleErrors
\r
1786 Dim resultsFile As String
\r
1787 Dim fso As New FileSystemObject
\r
1790 mbAllowExit = True
\r
1792 resultsFile = getOutputDir & "\" & txtResultsName.Text
\r
1794 If GetIniSetting(COUTPUT_TYPE) = COUTPUT_TYPE_XML Or _
\r
1795 GetIniSetting(COUTPUT_TYPE) = COUTPUT_TYPE_BOTH Then
\r
1797 Dim base As String
\r
1798 Dim path As String
\r
1799 base = fso.GetParentFolderName(resultsFile) & "\" & fso.GetBaseName(txtResultsName.Text)
\r
1800 If CheckWordDocsToAnalyze Then
\r
1801 path = base & "_" & CAPPNAME_WORD & "." & COUTPUT_TYPE_XML
\r
1803 If CheckExcelDocsToAnalyze Then
\r
1804 If path <> "" Then path = path & vbLf
\r
1805 path = path & base & "_" & CAPPNAME_EXCEL & "." & COUTPUT_TYPE_XML
\r
1807 If CheckPPDocsToAnalyze Then
\r
1808 If path <> "" Then path = path & vbLf
\r
1809 path = path & base & "_" & CAPPNAME_POWERPOINT & "." & COUTPUT_TYPE_XML
\r
1812 str = ReplaceTopic2Tokens(GetResString(XML_RESULTS_ID), _
\r
1813 TOPIC_STR, path, CR_STR, Chr(13))
\r
1815 MsgBox str, vbInformation
\r
1816 If GetIniSetting(COUTPUT_TYPE) = COUTPUT_TYPE_XML Then
\r
1821 If Not fso.FileExists(resultsFile) Then
\r
1822 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_RESULTS_DOC), _
\r
1823 TOPIC_STR, resultsFile, CR_STR, Chr(13))
\r
1825 MsgBox str, vbCritical
\r
1829 Dim xl As Excel.application
\r
1830 Set xl = New Excel.application
\r
1832 xl.Workbooks.Open resultsFile
\r
1840 WriteDebug "Document Analysis: View Analysis Results" & Err.Number & " " & Err.Description & " " & Err.Source
\r
1843 Private Sub Form_Activate()
\r
1844 Dim currentFunctionName As String
\r
1845 Dim missingFile As String
\r
1846 currentFunctionName = "Form_Activate"
\r
1847 On Error GoTo HandleErrors
\r
1849 If Not CheckNeededFiles(missingFile) Then
\r
1851 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_WORD_DRIVER), _
\r
1852 TOPIC_STR, missingFile, CR_STR, Chr(13))
\r
1854 MsgBox str, vbCritical
\r
1856 End 'Exit application - some needed files are missing
\r
1863 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
1867 Private Sub Form_Initialize()
\r
1868 Dim currentFunctionName As String
\r
1869 currentFunctionName = "Form_Initialize"
\r
1870 On Error GoTo ErrorHandler
\r
1871 Call InitCommonControls 'Use Windows XP Visual Style
\r
1877 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
1881 Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
\r
1882 If KeyCode = vbKeyF1 Then
\r
1883 'cmdNav_Click BTN_HELP
\r
1887 Private Sub Form_Load()
\r
1888 Const COS_CHECK = "oscheck"
\r
1890 On Error GoTo HandleErrors
\r
1891 Dim currentFunctionName As String
\r
1892 currentFunctionName = "Form_Load"
\r
1894 Dim fso As New FileSystemObject
\r
1897 mbFinishOK = False
\r
1901 mLogFilePath = GetLogFilePath
\r
1902 mIniFilePath = GetIniFilePath
\r
1903 mbDocCountCurrent = False
\r
1904 mbDoPrepare = False
\r
1905 mbAllowExit = False
\r
1907 'Check OS before running
\r
1908 Dim bOSCheck As Boolean
\r
1909 bOSCheck = IIf(GetIniSetting(COS_CHECK) = "False", False, True)
\r
1912 If Not IsWin98Plus Then
\r
1914 Dim winVer As RGB_WINVER
\r
1915 str = ReplaceTopic2Tokens(GetResString(ERR_SUPPORTED_OSVERSION), _
\r
1916 TOPIC_STR, GetWinVersion(winVer), CR_STR, Chr(13))
\r
1918 MsgBox str, vbCritical
\r
1920 End 'Exit application - unsupported OS
\r
1924 WriteDebug "IsWin2000Plus OS Check bypassed by analysis.ini oscheck=False setting"
\r
1928 For i = 0 To NUM_STEPS - 1
\r
1929 fraStep(i).Left = -10000
\r
1932 'Load All string info for Form
\r
1935 frmWizard.Caption = ReplaceTopicTokens(GetResString(TITLE_ID), CPRODUCTNAME_STR, _
\r
1936 GetResString(PRODUCTNAME_ID))
\r
1937 lblIntroduction1.Caption = ReplaceTopicTokens(GetResString(INTRO1_ID), CPRODUCTNAME_STR, _
\r
1938 GetResString(PRODUCTNAME_ID))
\r
1939 mLblSteps = GetResString(LBL_STEPS_ID)
\r
1940 mChbSubdirs = GetResString(CHK_SUBDIRS_ID)
\r
1942 ' Setup Doc Preparation specific strings
\r
1943 If gBoolPreparation Then
\r
1945 lblStep1_4.Caption = GetResString(RID_STR_ENG_SIDEBAR_ANALYZE_PREP_ID)
\r
1946 lblStep2_4.Caption = GetResString(RID_STR_ENG_SIDEBAR_ANALYZE_PREP_ID)
\r
1947 lblStep3_4.Caption = GetResString(RID_STR_ENG_SIDEBAR_ANALYZE_PREP_ID)
\r
1948 lblStep4_4.Caption = GetResString(RID_STR_ENG_SIDEBAR_ANALYZE_PREP_ID)
\r
1950 ' Preparation - Step 1. Introduction
\r
1951 lblIntroduction1.Caption = ReplaceTopicTokens(GetResString(RID_STR_ENG_INTRODUCTION_INTRO1_PREP_ID), CPRODUCTNAME_STR, _
\r
1952 GetResString(PRODUCTNAME_ID))
\r
1953 lblIntroduction2.Caption = GetResString(RID_STR_ENG_INTRODUCTION_INTRO2_PREP_ID)
\r
1954 lblIntroduction3.Caption = GetResString(RID_STR_ENG_INTRODUCTION_INTRO3_PREP_ID)
\r
1956 ' Preparation - Step 2. Documents
\r
1957 lblChooseDocs.Caption = GetResString(RID_STR_ENG_DOCUMENTS_CHOOSE_DOCUMENTS_PREP_ID)
\r
1958 lblDocTypes.Caption = GetResString(RID_STR_ENG_DOCUMENTS_CHOOSE_DOC_TYPES_PREP_ID)
\r
1959 'mChbSubdirs = GetResString(RID_STR_ENG_DOCUMENTS_INCLUDE_SUBDIRECTORIES_PREP_ID)
\r
1960 chkIgnoreOld.Caption = GetResString(RID_STR_IGNORE_OLDER_CB_ID)
\r
1963 cbIgnoreOld.AddItem (GetResString(RID_STR_IGNORE_OLDER_3_MONTHS_ID))
\r
1964 cbIgnoreOld.AddItem (GetResString(RID_STR_IGNORE_OLDER_6_MONTHS_ID))
\r
1965 cbIgnoreOld.AddItem (GetResString(RID_STR_IGNORE_OLDER_12_MONTHS_ID))
\r
1966 cbIgnoreOld.ListIndex = 0
\r
1968 ' Preparation - Step 3. Results
\r
1969 lblChooseResults.Caption = GetResString(RID_STR_ENG_RESULTS_CHOOSE_OPTIONS_PREP_ID)
\r
1970 txtResultsName.Text = GetResString(RID_STR_ENG_RESULTS_ANALYSIS_XLS_PREP_ID)
\r
1972 'Show Append option
\r
1973 rdbResultsAppend.Visible = True
\r
1975 ' Preparation - Step 4. Analysis
\r
1976 lblSetupDone.Caption = GetResString(RID_STR_ENG_ANALYZE_SETUP_COMPLETE_PREP_ID)
\r
1977 btnPrepare.Visible = True
\r
1979 ' The next line is a work around for a wrong translated string and should be removed
\r
1980 ' when RID_STR_ENG_RESULTS_CHOOSE_OPTIONS has been corrected
\r
1981 lblChooseResults.Caption = GetResString(RID_STR_ENG_RESULTS_CHOOSE_OPTIONS_PREP_ID)
\r
1982 mDefaultPassword = IIf(GetIniSetting(CDEFAULT_PASSWORD) = "", _
\r
1983 CSTR_TEST_PASSWORD, GetIniSetting(CDEFAULT_PASSWORD))
\r
1986 SetStep 0, DIR_NEXT
\r
1987 Dim tmpStr As String
\r
1990 tmpStr = GetIniSetting(CINPUT_DIR)
\r
1991 If tmpStr <> "" Then
\r
1992 txtInputDir.Text = tmpStr
\r
1993 txtInputDir.ToolTipText = tmpStr
\r
1995 tmpStr = GetIniSetting(COUTPUT_DIR)
\r
1996 If tmpStr <> "" Then
\r
1997 If Right(tmpStr, 1) = ":" And Len(tmpStr) = 2 Then
\r
1998 tmpStr = tmpStr & "\"
\r
2000 txtOutputDir.Text = tmpStr
\r
2001 txtOutputDir.ToolTipText = tmpStr
\r
2003 tmpStr = GetIniSetting(CRESULTS_FILE)
\r
2004 If tmpStr <> "" Then txtResultsName.Text = tmpStr
\r
2006 rdbResultsPrompt.value = False
\r
2007 rdbResultsOverwrite.value = False
\r
2008 rdbResultsAppend.value = False
\r
2009 Dim resultsSetting As String
\r
2010 resultsSetting = GetIniSetting(CRESULTS_EXIST)
\r
2011 If resultsSetting = CPROMPT_FILE Then
\r
2012 rdbResultsPrompt.value = True
\r
2013 ElseIf resultsSetting = CAPPEND_FILE Then
\r
2014 rdbResultsAppend.value = True
\r
2016 rdbResultsOverwrite.value = True
\r
2019 chkWordDoc.value = IIf(GetIniSetting(CTYPE_WORDDOC) = CStr(True), vbChecked, 0)
\r
2020 chkWordTemplate.value = IIf(GetIniSetting(CTYPE_WORDDOT) = CStr(True), vbChecked, 0)
\r
2021 chkExcelDoc.value = IIf(GetIniSetting(CTYPE_EXCELDOC) = CStr(True), vbChecked, 0)
\r
2022 chkExcelTemplate.value = IIf(GetIniSetting(CTYPE_EXCELDOT) = CStr(True), vbChecked, 0)
\r
2023 chkPPDoc.value = IIf(GetIniSetting(CTYPE_PPDOC) = CStr(True), vbChecked, 0)
\r
2024 chkPPTemplate.value = IIf(GetIniSetting(CTYPE_PPDOT) = CStr(True), vbChecked, 0)
\r
2025 chkIncludeSubdirs.value = IIf(GetIniSetting(CINCLUDE_SUBDIRS) = CStr(True), vbChecked, 0)
\r
2026 mDebugLevel = IIf(GetIniSetting(CDEBUG_LEVEL) = "", CDEBUG_LEVEL_DEFAULT, GetIniSetting(CDEBUG_LEVEL))
\r
2027 chkIgnoreOld.value = IIf(GetIniSetting(CIGNORE_OLD_DOCS) = CStr(True), vbChecked, 0)
\r
2029 mIssueLimit = IIf(GetIniSetting(CISSUE_LIMIT) = "", CISSUE_LIMIT_DAW, GetIniSetting(CISSUE_LIMIT))
\r
2030 If (mIssueLimit <= 3) Then
\r
2031 cbIgnoreOld.ListIndex = 0
\r
2032 ElseIf (mIssueLimit <= 6) Then
\r
2033 cbIgnoreOld.ListIndex = 1
\r
2035 cbIgnoreOld.ListIndex = 2
\r
2038 'Always ensure at least one doc type is selected on startup
\r
2039 If (chkWordDoc.value <> vbChecked) And _
\r
2040 (chkWordTemplate.value <> vbChecked) And _
\r
2041 (chkExcelDoc.value <> vbChecked) And _
\r
2042 (chkExcelTemplate.value <> vbChecked) And _
\r
2043 (chkPPDoc.value <> vbChecked) And _
\r
2044 (chkPPTemplate.value <> vbChecked) Then
\r
2046 chkWordDoc.value = vbChecked
\r
2054 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2058 Private Sub SetStep(nStep As Integer, nDirection As Integer)
\r
2059 On Error GoTo HandleError
\r
2060 Const driveTypeIsCDROM = 4
\r
2062 Dim fso As Scripting.FileSystemObject
\r
2063 Set fso = New Scripting.FileSystemObject
\r
2067 mbDocCountCurrent = False
\r
2071 'MsgBox "Enter Intro"
\r
2073 'Leave Introduction
\r
2074 'Workaround - resource bug for SubDir checkbox, have to set it explicitly
\r
2075 chkIncludeSubdirs.Caption = mChbSubdirs
\r
2079 Set drive = fso.GetDrive(fso.GetDriveName(txtInputDir.Text))
\r
2080 If drive.DriveType = driveTypeIsCDROM Then
\r
2081 If Not drive.IsReady Then
\r
2082 MsgBox GetResString(ERR_CDROM_NOT_READY), vbCritical
\r
2087 If txtInputDir.Text = "" Or Not fso.FolderExists(txtInputDir.Text) Then ' fso.FolderExists() has replaced dir()
\r
2088 MsgBox ReplaceTopicTokens(GetResString(ERR_NO_DOC_DIR), _
\r
2089 CR_STR, Chr(13)), vbCritical
\r
2093 If Not CheckUserChosenDocsToAnalyze Then
\r
2094 MsgBox GetResString(ERR_NO_DOC_TYPES), vbCritical
\r
2097 'Expand directory name only without path to full path
\r
2098 txtInputDir.Text = fso.GetAbsolutePathName(txtInputDir.Text)
\r
2100 If txtOutputDir.Text = "" Then
\r
2101 txtOutputDir.Text = txtInputDir.Text
\r
2104 mbFinishOK = False
\r
2106 'Workaround - label resource bug for Steps, have to set it explicitly
\r
2107 Label12(0).Caption = mLblSteps
\r
2108 Label12(5).Caption = mLblSteps
\r
2111 If Not CheckResultsDir(getOutputDir) Then
\r
2115 'Expand directory name only without path to full path
\r
2116 txtOutputDir.Text = fso.GetAbsolutePathName(txtOutputDir)
\r
2118 'Check Results file is there and has a valid extension
\r
2119 If fso.GetBaseName(txtResultsName.Text) = "" Then
\r
2120 txtResultsName.Text = GetResString(SETUP_ANALYSIS_XLS_ID)
\r
2122 txtResultsName.Text = fso.GetBaseName(txtResultsName.Text) & CRESULTS_FILE_EXTENSION
\r
2124 Screen.MousePointer = vbHourglass
\r
2125 DeleteFile mLogFilePath
\r
2126 Set mDocFiles = Nothing
\r
2127 If Not CheckNumberDocsToAnalyze Then
\r
2128 Screen.MousePointer = vbDefault
\r
2132 Screen.MousePointer = vbDefault
\r
2134 btnRunAnalysis.Enabled = True
\r
2136 If GetNumberOfDocsToAnalyze = 0 Then
\r
2137 btnRunAnalysis.Enabled = False
\r
2140 'Backup configuration
\r
2141 If Not AttemptToCopyFile(mIniFilePath, mIniFilePath & CCONFIG_BACKUP_EXT) Then
\r
2145 'Save current Wizard Settings
\r
2146 WriteWizardSettingsToLog mIniFilePath
\r
2148 'If results file already exists, enable View and Prepare
\r
2149 If fso.FileExists(getOutputDir & "\" & txtResultsName.Text) Then
\r
2150 btnViewResults.Enabled = True
\r
2151 btnPrepare.Enabled = True
\r
2158 fraStep(mnCurStep).Enabled = False
\r
2159 fraStep(nStep).Left = 0
\r
2160 If nStep <> mnCurStep Then
\r
2161 fraStep(mnCurStep).Left = -10000
\r
2162 fraStep(mnCurStep).Enabled = False
\r
2164 fraStep(nStep).Enabled = True
\r
2171 Set drive = Nothing
\r
2175 Screen.MousePointer = vbDefault
\r
2176 WriteDebug "Document Analysis: SetStep() " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2181 Function CheckResultsDir(resultsDir As String) As Boolean
\r
2182 On Error GoTo HandleError
\r
2183 Dim fso As Scripting.FileSystemObject
\r
2184 Set fso = New Scripting.FileSystemObject
\r
2185 Const driveTypeIsCDROM = 4
\r
2186 Const readOnlyFolderRemainder = 1
\r
2188 CheckResultsDir = False
\r
2190 If resultsDir = "" Then
\r
2191 MsgBox ReplaceTopicTokens(GetResString(ERR_NO_RESULTS_DIRECTORY), _
\r
2192 CR_STR, Chr(13)), vbCritical
\r
2193 CheckResultsDir = False
\r
2197 Set drive = fso.GetDrive(fso.GetDriveName(resultsDir))
\r
2198 If drive.DriveType = driveTypeIsCDROM Then 'If CD-ROM Drive Then
\r
2199 Dim Msg1 As String
\r
2200 Msg1 = ReplaceTopic2Tokens(GetResString(ERR_CREATE_FILE), _
\r
2201 TOPIC_STR, txtResultsName.Text, CR_STR, Chr(13))
\r
2202 MsgBox Msg1, vbCritical
\r
2203 CheckResultsDir = False
\r
2208 If Not fso.FolderExists(resultsDir) Then
\r
2209 Dim Msg, Style, response
\r
2211 Msg = ReplaceTopicTokens(GetResString(ERR_NO_RES_DIR), CR_STR, Chr(13))
\r
2212 Style = vbYesNo + vbQuestion + vbDefaultButton1 ' Define buttons.
\r
2214 response = MsgBox(Msg, Style)
\r
2215 If response = vbYes Then ' User chose Yes.
\r
2216 If Not CreateDir(getOutputDir) Then
\r
2217 CheckResultsDir = False
\r
2220 Else ' User chose No.
\r
2221 CheckResultsDir = False
\r
2226 Dim testFile As String
\r
2227 testFile = resultsDir & "\" & fso.GetTempName
\r
2228 Do While fso.FileExists(testFile)
\r
2229 testFile = resultsDir & "\" & fso.GetTempName
\r
2232 On Error GoTo HandleReadOnly
\r
2233 Dim aText As TextStream
\r
2234 Set aText = fso.CreateTextFile(testFile, False, False)
\r
2235 aText.WriteLine ("Dies ist ein Test.")
\r
2237 fso.DeleteFile (testFile)
\r
2239 ' GetAttr doesn't work reliable ( returns read only for 'my Documents' and rw for read only network folder
\r
2240 ' If ((GetAttr(resultsDir) Mod 2) = readOnlyFolderRemainder) Then 'If the attribute is odd then the folder is read-only
\r
2241 ' MsgBox GetResString(ERR_NO_WRITE_TO_READ_ONLY_FOLDER), vbCritical
\r
2242 ' CheckResultsDir = False
\r
2246 CheckResultsDir = True
\r
2250 WriteDebug "Document Analysis: CheckResultsDir() " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2251 CheckResultsDir = False
\r
2255 str = ReplaceTopic2Tokens(GetResString(ERR_CREATE_FILE), _
\r
2256 TOPIC_STR, txtResultsName.Text, CR_STR, Chr(13))
\r
2257 MsgBox str, vbCritical
\r
2258 CheckResultsDir = False
\r
2262 Function CheckUserChosenDocsToAnalyze() As Boolean
\r
2263 CheckUserChosenDocsToAnalyze = Not ((chkWordDoc.value <> vbChecked) And (chkWordTemplate.value <> vbChecked) And _
\r
2264 (chkExcelDoc.value <> vbChecked) And (chkExcelTemplate.value <> vbChecked) And _
\r
2265 (chkPPDoc.value <> vbChecked) And (chkPPTemplate.value <> vbChecked))
\r
2268 Function AttemptToCopyFile(Source As String, dest As String) As Boolean
\r
2269 On Error GoTo HandleErrors
\r
2270 Dim fso As Scripting.FileSystemObject
\r
2271 Set fso = New Scripting.FileSystemObject
\r
2273 If fso.FileExists(Source) Then
\r
2274 fso.CopyFile Source, dest
\r
2277 'True if no source or copy succeded
\r
2278 AttemptToCopyFile = True
\r
2285 AttemptToCopyFile = False
\r
2287 str = ReplaceTopic2Tokens(GetResString(ERR_CREATE_FILE), _
\r
2288 TOPIC_STR, mIniFilePath & CCONFIG_BACKUP_EXT, CR_STR, Chr(13))
\r
2293 Function CreateDir(dir As String) As Boolean
\r
2294 On Error GoTo HandleErrors
\r
2295 Dim fso As Scripting.FileSystemObject
\r
2296 Set fso = New Scripting.FileSystemObject
\r
2298 fso.CreateFolder (dir)
\r
2308 str = ReplaceTopic2Tokens(GetResString(ERR_CREATE_DIR), _
\r
2309 TOPIC_STR, dir, CR_STR, Chr(13))
\r
2310 Select Case Err.Number
\r
2313 MsgBox str, vbCritical
\r
2316 'Don't care if it exists already
\r
2320 MsgBox str, vbCritical
\r
2326 Private Sub SetNavBtns(nStep As Integer)
\r
2329 If mnCurStep = 0 Then
\r
2330 cmdNav(BTN_BACK).Enabled = False
\r
2331 cmdNav(BTN_NEXT).Enabled = True
\r
2332 ElseIf mnCurStep = NUM_STEPS - 1 Then
\r
2333 cmdNav(BTN_NEXT).Enabled = False
\r
2334 cmdNav(BTN_BACK).Enabled = True
\r
2336 cmdNav(BTN_BACK).Enabled = True
\r
2337 cmdNav(BTN_NEXT).Enabled = True
\r
2340 If mbFinishOK Then
\r
2341 cmdNav(BTN_FINISH).Enabled = True
\r
2343 cmdNav(BTN_FINISH).Enabled = False
\r
2346 Function CheckForSupportedApp(app As String, lowerVerLimit As Long) As Boolean
\r
2347 Dim appRegStr As String
\r
2348 Dim appVer As Long
\r
2349 appRegStr = GetRegistryInfo(HKEY_CLASSES_ROOT, app & ".Application\CurVer", "")
\r
2350 appVer = val(Right(appRegStr, Len(appRegStr) - Len(app & ".Application.")))
\r
2351 If appVer >= lowerVerLimit Then
\r
2352 CheckForSupportedApp = True
\r
2354 CheckForSupportedApp = False
\r
2357 Function GetAppVersion(app As String) As Long
\r
2358 Dim appRegStr As String
\r
2359 Dim appVer As Long
\r
2360 appRegStr = GetRegistryInfo(HKEY_CLASSES_ROOT, app & ".Application\CurVer", "")
\r
2361 GetAppVersion = val(Right(appRegStr, Len(appRegStr) - Len(app & ".Application.")))
\r
2363 Function GetInstalledApp(app As String) As String
\r
2364 GetInstalledApp = GetRegistryInfo(HKEY_CLASSES_ROOT, app & ".Application\CurVer", "")
\r
2367 Sub WriteInfoToApplicationLog(wordAppStr As String, excelAppStr As String, ppAppStr As String)
\r
2368 On Error GoTo HandleErrors
\r
2369 Dim currentFunctionName As String
\r
2370 currentFunctionName = "WriteInfoToApplicationLog"
\r
2372 Dim userLCID As Long
\r
2373 userLCID = GetUserDefaultLCID()
\r
2374 Dim sysLCID As Long
\r
2375 sysLCID = GetSystemDefaultLCID()
\r
2377 WriteToLog CWORD_VERSION, IIf(wordAppStr <> "", wordAppStr, CNOT_INSTALLED)
\r
2378 WriteToLog CEXCEL_VERSION, IIf(excelAppStr <> "", excelAppStr, CNOT_INSTALLED)
\r
2379 WriteToLog CPOWERPOINT_VERSION, IIf(ppAppStr <> "", ppAppStr, CNOT_INSTALLED)
\r
2381 WriteToLog CUSER_LOCALE_INFO, _
\r
2382 "langid: " & GetUserLocaleInfo(userLCID, LOCALE_ILANGUAGE) & ": " & _
\r
2383 GetUserLocaleInfo(userLCID, LOCALE_SENGLANGUAGE) & _
\r
2384 "-" & GetUserLocaleInfo(userLCID, LOCALE_SENGCOUNTRY) & _
\r
2385 " abrv: " & GetUserLocaleInfo(userLCID, LOCALE_SISO639LANGNAME) & _
\r
2386 "-" & GetUserLocaleInfo(userLCID, LOCALE_SISO3166CTRYNAME) & _
\r
2387 " sdate: " & GetUserLocaleInfo(userLCID, LOCALE_SSHORTDATE)
\r
2389 WriteToLog CSYS_LOCALE_INFO, _
\r
2390 "langid: " & GetUserLocaleInfo(sysLCID, LOCALE_ILANGUAGE) & ": " & _
\r
2391 GetUserLocaleInfo(sysLCID, LOCALE_SENGLANGUAGE) & _
\r
2392 "-" & GetUserLocaleInfo(sysLCID, LOCALE_SENGCOUNTRY) & _
\r
2393 " abrv: " & GetUserLocaleInfo(sysLCID, LOCALE_SISO639LANGNAME) & _
\r
2394 "-" & GetUserLocaleInfo(sysLCID, LOCALE_SISO3166CTRYNAME) & _
\r
2395 " sdate: " & GetUserLocaleInfo(userLCID, LOCALE_SSHORTDATE)
\r
2397 Dim myWinVer As RGB_WINVER
\r
2398 GetWinVersion myWinVer
\r
2399 WriteToLog CWINVERSION, myWinVer.VersionName & " " & myWinVer.VersionNo & _
\r
2400 " " & myWinVer.ServicePack & _
\r
2401 " build " & myWinVer.BuildNo
\r
2402 WriteToLog CNUMBER_TOTAL_DOCS, CStr(mTotalDocCount)
\r
2403 WriteToLog CNUMBER_DOCS_DOC, CStr(mWordDocCount)
\r
2404 WriteToLog CNUMBER_TEMPLATES_DOT, CStr(mWordTemplateCount)
\r
2405 WriteToLog CNUMBER_DOCS_XLS, CStr(mExcelDocCount)
\r
2406 WriteToLog CNUMBER_TEMPLATES_XLT, CStr(mExcelTemplateCount)
\r
2407 WriteToLog CNUMBER_DOCS_PPT, CStr(mPPDocCount)
\r
2408 WriteToLog CNUMBER_TEMPLATES_POT, CStr(mPPTemplateCount)
\r
2413 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2417 Function CheckTemplatePath(sMigrationResultsTemplatePath As String, fso As FileSystemObject) As Boolean
\r
2418 If Not fso.FileExists(sMigrationResultsTemplatePath) Then
\r
2420 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_RESULTS_TEMPLATE), _
\r
2421 TOPIC_STR, sMigrationResultsTemplatePath, CR_STR, Chr(13))
\r
2423 MsgBox str, vbCritical
\r
2424 CheckTemplatePath = False
\r
2426 CheckTemplatePath = True
\r
2430 Function RunAnalysis(bDoPrepare) As Boolean
\r
2431 On Error GoTo HandleErrors
\r
2432 Dim currentFunctionName As String
\r
2433 currentFunctionName = "RunAnalysis"
\r
2434 Dim tstart As Single 'timer var for this routine only
\r
2435 Dim tend As Single 'timer var for this routine only
\r
2436 Dim fso As New FileSystemObject
\r
2437 Dim wordAppStr As String
\r
2438 Dim excelAppStr As String
\r
2439 Dim ppAppStr As String
\r
2440 Dim sMigrationResultsTemplatePath As String
\r
2441 Dim startDate As Variant
\r
2446 tstart = GetTickCount()
\r
2448 app.OleRequestPendingMsgText = GetResString(RUNBTN_RUNNING_ID)
\r
2449 app.OleRequestPendingMsgTitle = frmWizard.Caption
\r
2451 wordAppStr = GetInstalledApp(CAPPNAME_WORD)
\r
2452 excelAppStr = GetInstalledApp(CAPPNAME_EXCEL)
\r
2453 ppAppStr = GetInstalledApp(CAPPNAME_POWERPOINT)
\r
2454 'Write locale, version info and settings to the Application log
\r
2455 WriteInfoToApplicationLog wordAppStr, excelAppStr, ppAppStr
\r
2457 'Check for template
\r
2458 sMigrationResultsTemplatePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CRESULTS_TEMPLATE_FILE)
\r
2459 If Not CheckTemplatePath(sMigrationResultsTemplatePath, fso) Then
\r
2464 'Check for installed Apps
\r
2465 If Not CheckInstalledApps(wordAppStr, excelAppStr, ppAppStr) Then
\r
2470 If bDoPrepare Then
\r
2471 'Show MsgBox ( to give apps some time to quit )
\r
2472 Dim strMsgBox As String
\r
2473 Dim response As Integer
\r
2475 strMsgBox = ReplaceTopic2Tokens(GetResString(RID_STR_ENG_OTHER_PREPARE_PROMPT_PREP_ID), _
\r
2476 TOPIC_STR, getOutputDir & "\" & txtResultsName.Text, TOPIC2_STR, getOutputDir)
\r
2477 strMsgBox = ReplaceTopicTokens(strMsgBox, CR_STR, Chr(13))
\r
2478 response = MsgBox(strMsgBox, Buttons:=vbOKCancel + vbInformation)
\r
2480 If response <> vbOK Then
\r
2486 'Write Wizard Setting to Application log
\r
2487 WriteWizardSettingsToLog mLogFilePath
\r
2489 'Write to Analysis ini file - used by driver docs
\r
2490 WriteCommonParamsToLog sMigrationResultsTemplatePath, mLogFilePath, mIniFilePath, fso
\r
2492 Screen.MousePointer = vbHourglass
\r
2493 ' Doc Counts are setup by CheckNumberDocsToAnalyze() when user moves to Analysis Panel
\r
2494 ' Takes account of user Options selected and inspects source directory
\r
2495 Dim analysisAborted As Boolean
\r
2496 analysisAborted = False
\r
2498 SetupInputVariables mLogFilePath, fso
\r
2501 Call ShowProgress.SP_Init(mDocFiles.WordFiles.count + _
\r
2502 mDocFiles.ExcelFiles.count + _
\r
2503 mDocFiles.PowerPointFiles.count)
\r
2505 Dim myOffset As Long
\r
2507 If (mDocFiles.WordFiles.count > 0) Then
\r
2508 bSuccess = AnalyseList(mDocFiles.WordFiles, "word", mIniFilePath, myOffset, analysisAborted)
\r
2509 'bSuccess = RunWordAnalysis(sMigrationResultsTemplatePath, mLogFilePath, fso)
\r
2512 myOffset = mDocFiles.WordFiles.count
\r
2513 If ((mDocFiles.ExcelFiles.count > 0) And (Not analysisAborted)) Then
\r
2514 bSuccess = bSuccess And _
\r
2515 AnalyseList(mDocFiles.ExcelFiles, "excel", mIniFilePath, myOffset, analysisAborted)
\r
2516 'bSuccess = RunExcelAnalysis(sMigrationResultsTemplatePath, mLogFilePath, fso)
\r
2519 myOffset = myOffset + mDocFiles.ExcelFiles.count
\r
2520 If ((mDocFiles.PowerPointFiles.count > 0) And (Not analysisAborted)) Then
\r
2521 bSuccess = bSuccess And _
\r
2522 AnalyseList(mDocFiles.PowerPointFiles, "pp", mIniFilePath, myOffset, analysisAborted)
\r
2523 'bSuccess = RunPPAnalysis(sMigrationResultsTemplatePath, mLogFilePath, fso)
\r
2526 SetupInputVariables mLogFilePath, fso
\r
2528 tend = GetTickCount()
\r
2529 WriteToLog CELAPSED_TIME, (FormatNumber((tend - tstart) / 1000, 0) & " seconds: ") & _
\r
2530 (FormatNumber((tend - tstart), 0) & " miliseconds")
\r
2533 Unload ShowProgress
\r
2534 Screen.MousePointer = vbDefault
\r
2535 WriteToLog CSTART_TIME, CDate(startDate)
\r
2536 WriteToLog CEND_TIME, Now
\r
2539 RunAnalysis = bSuccess
\r
2544 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2548 Function CheckInstalledApps(wordAppStr As String, excelAppStr As String, ppAppStr As String) As Boolean
\r
2549 On Error GoTo HandleErrors
\r
2550 Dim currentFunctionName As String
\r
2552 currentFunctionName = "CheckInstalledApps"
\r
2554 Dim missingInstalledApps As String
\r
2555 Dim unsupportedApps As String
\r
2556 Dim runningApps As String
\r
2557 Dim bSuccess As Boolean
\r
2561 If mWordDocCount > 0 Or mWordTemplateCount > 0 Then
\r
2562 If wordAppStr = "" Then 'Word not installed
\r
2563 missingInstalledApps = CAPPNAME_WORD
\r
2564 ElseIf Not CheckForSupportedApp(CAPPNAME_WORD, CSUPPORTED_VERSION) Then
\r
2565 unsupportedApps = CAPPNAME_WORD
\r
2566 ElseIf IsOfficeAppRunning(CAPPNAME_WORD) Then
\r
2567 runningApps = CAPPNAME_WORD
\r
2571 If excelAppStr = "" Then
\r
2572 If missingInstalledApps <> "" Then missingInstalledApps = missingInstalledApps & ", "
\r
2573 missingInstalledApps = missingInstalledApps & CAPPNAME_EXCEL
\r
2574 ElseIf Not CheckForSupportedApp(CAPPNAME_EXCEL, CSUPPORTED_VERSION) Then
\r
2575 If unsupportedApps <> "" Then unsupportedApps = unsupportedApps & ", "
\r
2576 unsupportedApps = unsupportedApps & CAPPNAME_EXCEL
\r
2577 ElseIf IsOfficeAppRunning(CAPPNAME_EXCEL) Then
\r
2578 If runningApps <> "" Then runningApps = runningApps & ", "
\r
2579 runningApps = runningApps & CAPPNAME_EXCEL
\r
2582 If mPPDocCount > 0 Or mPPTemplateCount > 0 Then
\r
2583 If ppAppStr = "" Then 'PP not installed
\r
2584 If missingInstalledApps <> "" Then missingInstalledApps = missingInstalledApps & ", "
\r
2585 missingInstalledApps = missingInstalledApps & CAPPNAME_POWERPOINT
\r
2586 ElseIf Not CheckForSupportedApp(CAPPNAME_POWERPOINT, CSUPPORTED_VERSION) Then
\r
2587 If unsupportedApps <> "" Then unsupportedApps = unsupportedApps & ", "
\r
2588 unsupportedApps = unsupportedApps & CAPPNAME_POWERPOINT
\r
2589 ElseIf IsOfficeAppRunning(CAPPNAME_POWERPOINT) Then
\r
2590 If runningApps <> "" Then runningApps = runningApps & ", "
\r
2591 runningApps = runningApps & CAPPNAME_POWERPOINT
\r
2595 If missingInstalledApps <> "" Then
\r
2596 str = ReplaceTopic2Tokens(GetResString(ERR_NOT_INSTALLED), _
\r
2597 TOPIC_STR, missingInstalledApps, CR_STR, Chr(13))
\r
2599 MsgBox str, vbCritical
\r
2603 If unsupportedApps <> "" Then
\r
2604 str = ReplaceTopic2Tokens(GetResString(ERR_SUPPORTED_VERSION), _
\r
2605 TOPIC_STR, unsupportedApps, CR_STR, Chr(13))
\r
2607 MsgBox str, vbCritical
\r
2611 If runningApps <> "" Then
\r
2612 str = ReplaceTopic2Tokens(GetResString(ERR_APPLICATION_IN_USE), _
\r
2613 TOPIC_STR, runningApps, CR_STR, Chr(13))
\r
2615 MsgBox str, vbCritical
\r
2619 'Check for Excel automation server
\r
2620 If CheckForExcel Then
\r
2621 str = ReplaceTopicTokens(GetResString(ERR_EXCEL_OPEN), _
\r
2624 MsgBox str, vbCritical
\r
2632 CheckInstalledApps = bSuccess
\r
2637 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2641 Function RunPPAnalysis(resultsTemplate As String, logFile As String, fsObject As FileSystemObject) As Boolean
\r
2642 'DV: do we need this? get some error handling ideas here
\r
2643 On Error GoTo HandleErrors
\r
2644 Dim currentFunctionName As String
\r
2645 currentFunctionName = "RunPPAnalysis"
\r
2646 Const APP_PP = "PowerPoint"
\r
2651 If (chkPPDoc.value <> vbChecked) And (chkPPTemplate.value <> vbChecked) Then
\r
2652 RunPPAnalysis = True
\r
2656 Dim sPPDriverDocPath As String
\r
2658 sPPDriverDocPath = fsObject.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CPP_DRIVER_FILE)
\r
2659 If Not fsObject.FileExists(sPPDriverDocPath) Then
\r
2660 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_PP_DRIVER), _
\r
2661 TOPIC_STR, sPPDriverDocPath, CR_STR, Chr(13))
\r
2663 MsgBox str, vbCritical
\r
2668 Dim pp As PowerPoint.application
\r
2670 Dim aPres As PowerPoint.Presentation
\r
2671 Dim RegValue As Long
\r
2672 Set po = GetObject(sPPDriverDocPath)
\r
2673 Set pp = po.application
\r
2675 If val(pp.Version) < CSUPPORTED_VERSION Then
\r
2676 str = ReplaceTopic2Tokens(GetResString(ERR_SUPPORTED_VERSION), _
\r
2677 TOPIC_STR, pp.Version, CR_STR, Chr(13))
\r
2679 MsgBox str, vbCritical
\r
2684 If Not CheckForAccesToPPVBProject(pp, aPres) Then
\r
2686 If Not GiveAccessToMacroProject(APP_PP, pp.Version, RegValue) Then
\r
2687 Dim Style, response
\r
2688 str = ReplaceTopic2Tokens(GetResString(ERR_NO_ACCESS_TO_VBPROJECT), _
\r
2689 TOPIC_STR, CAPPNAME_POWERPOINT, CR_STR, Chr(13))
\r
2691 Style = vbYesNo + vbQuestion + vbDefaultButton1
\r
2693 response = MsgBox(str, Style)
\r
2694 If response <> vbYes Then
\r
2701 Set aPres = pp.Presentations(1)
\r
2702 Dim ppSlideHidden As PowerPoint.Slide
\r
2703 Set ppSlideHidden = aPres.Slides(2)
\r
2705 'Setup Input Variables
\r
2706 'SetupInputVariables resultsTemplate, logFile, fsObject, CAPPNAME_POWERPOINT
\r
2708 'Run PowerPoint Analysis
\r
2709 pp.Run (fsObject.GetFileName(CBASE_RESOURCE_DIR & "\" & CPP_DRIVER_FILE) & "!AnalysisDriver.AnalyseDirectory")
\r
2714 'Cannot seem to close it down from VB
\r
2715 'Workaround is to close it in macro
\r
2717 'If Not aPres Is Nothing Then
\r
2718 ' aPres.Saved = msoTrue
\r
2720 'If Not pp Is Nothing Then pp.Quit
\r
2722 'Swallow error as we are closing down PP from macro
\r
2723 'Does not seem to be possible to close it down from VB
\r
2724 On Error Resume Next
\r
2725 If RegValue <> -1 Then
\r
2726 SetDefaultRegValue APP_PP, pp.Version, RegValue
\r
2728 If RegValue = 0 Then
\r
2729 DeleteRegValue APP_PP, pp.Version
\r
2732 If Not pp Is Nothing Then
\r
2733 pp.Run (fsObject.GetFileName(CBASE_RESOURCE_DIR & "\" & CPP_DRIVER_FILE) & "!ApplicationSpecific.QuitPowerPoint")
\r
2737 Set aPres = Nothing
\r
2741 RunPPAnalysis = bSuccess
\r
2747 Dim failedDoc As String
\r
2749 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2751 failedDoc = GetDebug(CAPPNAME_POWERPOINT, CANALYZING)
\r
2752 If failedDoc = "" Or failedDoc = CSTR_ANALYSIS_LOG_DONE Then
\r
2753 str = ReplaceTopic2Tokens(GetResString(ERR_AUTOMATION_FAILURE), _
\r
2754 TOPIC_STR, CAPPNAME_POWERPOINT, CR_STR, Chr(13))
\r
2756 str = ReplaceTopic2Tokens(GetResString(ERR_PP_DRIVER_CRASH), _
\r
2757 TOPIC_STR, failedDoc, CR_STR, Chr(13))
\r
2761 MsgBox str, vbCritical
\r
2766 Sub SetupInputVariables(logFile As String, fso As FileSystemObject)
\r
2767 Dim bNewResultsFile As Boolean
\r
2769 bNewResultsFile = CheckCreateNewResultsFile(fso)
\r
2771 WriteToLog CNEW_RESULTS_FILE, IIf(bNewResultsFile, "True", "False"), mIniFilePath
\r
2772 WriteToLog CNEW_RESULTS_FILE, IIf(bNewResultsFile, "True", "False"), logFile
\r
2777 Function RunExcelAnalysis(resultsTemplate As String, logFile As String, fsObject As FileSystemObject) As Boolean
\r
2778 On Error GoTo HandleErrors
\r
2779 Dim currentFunctionName As String
\r
2780 currentFunctionName = "RunExcelAnalysis"
\r
2781 Const APP_EXCEL = "Excel"
\r
2786 If (chkExcelDoc.value <> vbChecked) And (chkExcelTemplate.value <> vbChecked) Then
\r
2787 RunExcelAnalysis = True
\r
2791 Dim xl As Excel.application
\r
2792 Dim aWb As Excel.Workbook
\r
2793 Dim sExcelDriverDocPath As String
\r
2794 Dim RegValue As Long
\r
2796 sExcelDriverDocPath = fsObject.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CEXCEL_DRIVER_FILE)
\r
2797 If Not fsObject.FileExists(sExcelDriverDocPath) Then
\r
2798 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_EXCEL_DRIVER), _
\r
2799 TOPIC_STR, sExcelDriverDocPath, CR_STR, Chr(13))
\r
2801 MsgBox str, vbCritical
\r
2806 Set xl = GetExcelInstance
\r
2807 If val(xl.Version) < CSUPPORTED_VERSION Then
\r
2808 str = ReplaceTopic2Tokens(GetResString(ERR_SUPPORTED_VERSION), _
\r
2809 TOPIC_STR, xl.Version, CR_STR, Chr(13))
\r
2811 MsgBox str, vbCritical
\r
2816 If Not CheckForAccesToExcelVBProject(xl) Then
\r
2818 If Not GiveAccessToMacroProject(APP_EXCEL, xl.Version, RegValue) Then
\r
2819 Dim Style, response
\r
2820 str = ReplaceTopic2Tokens(GetResString(ERR_NO_ACCESS_TO_VBPROJECT), _
\r
2821 TOPIC_STR, CAPPNAME_EXCEL, CR_STR, Chr(13))
\r
2823 Style = vbYesNo + vbQuestion + vbDefaultButton1
\r
2825 response = MsgBox(str, Style)
\r
2826 If response <> vbYes Then
\r
2833 Set aWb = xl.Workbooks.Open(fileName:=sExcelDriverDocPath)
\r
2834 'Setup Input Variables
\r
2835 'SetupInputVariables resultsTemplate, logFile, fsObject, CAPPNAME_EXCEL
\r
2837 'Run Excel Analysis
\r
2838 xl.Run ("AnalysisTool.AnalysisDriver.AnalyseDirectory")
\r
2842 If RegValue <> -1 Then
\r
2843 SetDefaultRegValue APP_EXCEL, xl.Version, RegValue
\r
2845 If RegValue = 0 Then
\r
2846 DeleteRegValue APP_EXCEL, xl.Version
\r
2849 If Not aWb Is Nothing Then
\r
2850 If xl.Workbooks.count = 1 Then
\r
2851 xl.Visible = False
\r
2857 If Not xl Is Nothing Then
\r
2858 If xl.Workbooks.count = 0 Then
\r
2865 RunExcelAnalysis = bSuccess
\r
2872 Dim failedDoc As String
\r
2874 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
2876 failedDoc = GetDebug(CAPPNAME_EXCEL, CANALYZING)
\r
2877 If failedDoc = "" Or failedDoc = CSTR_ANALYSIS_LOG_DONE Then
\r
2878 str = ReplaceTopic2Tokens(GetResString(ERR_AUTOMATION_FAILURE), _
\r
2879 TOPIC_STR, CAPPNAME_EXCEL, CR_STR, Chr(13))
\r
2881 str = ReplaceTopic2Tokens(GetResString(ERR_EXCEL_DRIVER_CRASH), _
\r
2882 TOPIC_STR, failedDoc, CR_STR, Chr(13))
\r
2886 MsgBox str, vbCritical
\r
2888 On Error Resume Next
\r
2892 Sub WriteWizardSettingsToLog(path As String)
\r
2893 '### DO NOT USE Boolean True/ False it is loaclised by the OS - use "True"/ "False"
\r
2894 WriteToLog CINPUT_DIR, getInputDir, path
\r
2895 WriteToLog CINCLUDE_SUBDIRS, IIf(chkIncludeSubdirs.value, "True", "False"), path
\r
2896 WriteToLog COUTPUT_DIR, getOutputDir, path
\r
2897 WriteToLog CRESULTS_FILE, txtResultsName.Text, path
\r
2899 WriteToLog CTYPE_WORDDOC, IIf(chkWordDoc.value, "True", "False"), path
\r
2900 WriteToLog CTYPE_WORDDOT, IIf(chkWordTemplate.value, "True", "False"), path
\r
2901 WriteToLog CTYPE_EXCELDOC, IIf(chkExcelDoc.value, "True", "False"), path
\r
2902 WriteToLog CTYPE_EXCELDOT, IIf(chkExcelTemplate.value, "True", "False"), path
\r
2903 WriteToLog CTYPE_PPDOC, IIf(chkPPDoc.value, "True", "False"), path
\r
2904 WriteToLog CTYPE_PPDOT, IIf(chkPPTemplate.value, "True", "False"), path
\r
2906 Dim resultsSetting As String
\r
2907 If rdbResultsPrompt.value Then
\r
2908 resultsSetting = CPROMPT_FILE
\r
2909 ElseIf rdbResultsAppend.value Then
\r
2910 resultsSetting = CAPPEND_FILE
\r
2912 resultsSetting = COVERWRITE_FILE
\r
2914 WriteToLog CRESULTS_EXIST, resultsSetting, path
\r
2916 WriteToLog CIGNORE_OLD_DOCS, IIf(chkIgnoreOld.value, "True", "False"), path
\r
2917 WriteToLog CISSUE_LIMIT, CStr(mIssueLimit), path
\r
2919 'WriteToLog CVERSION, Version, path
\r
2922 Sub WriteCommonParamsToLog(resultsTemplate As String, logFile As String, path As String, fso As Scripting.FileSystemObject)
\r
2923 WriteToLog CLOG_FILE, logFile, path
\r
2924 WriteToLog CRESULTS_TEMPLATE, resultsTemplate, path
\r
2925 WriteToLog CDEBUG_LEVEL, CLng(mDebugLevel), path
\r
2926 WriteToLog CDOPREPARE, IIf(mbDoPrepare, "True", "False"), path
\r
2927 WriteToLog CTITLE, frmWizard.Caption, path
\r
2928 WriteToLog CLAST_CHECKPOINT, ""
\r
2929 WriteToLog CNEXT_FILE, ""
\r
2930 WriteToLog C_ABORT_ANALYSIS, ""
\r
2933 Function GetNumberOfDocsToAnalyze() As Long
\r
2938 If CheckWordDocsToAnalyze Then
\r
2939 count = mWordDocCount + mWordTemplateCount
\r
2941 If CheckExcelDocsToAnalyze Then
\r
2942 count = count + mExcelDocCount + mExcelTemplateCount
\r
2944 If CheckPPDocsToAnalyze Then
\r
2945 count = count + mPPDocCount + mPPTemplateCount
\r
2948 GetNumberOfDocsToAnalyze = count
\r
2951 Function CheckWordDocsToAnalyze() As Boolean
\r
2953 CheckWordDocsToAnalyze = mbDocCountCurrent And (chkWordDoc.value = vbChecked And mWordDocCount > 0) Or _
\r
2954 (chkWordTemplate.value = vbChecked And mWordTemplateCount > 0)
\r
2957 Function CheckExcelDocsToAnalyze() As Boolean
\r
2958 CheckExcelDocsToAnalyze = mbDocCountCurrent And (chkExcelDoc.value = vbChecked And mExcelDocCount > 0) Or _
\r
2959 (chkExcelTemplate.value = vbChecked And mExcelTemplateCount > 0)
\r
2962 Function CheckPPDocsToAnalyze() As Boolean
\r
2963 CheckPPDocsToAnalyze = mbDocCountCurrent And (chkPPDoc.value = vbChecked And mPPDocCount > 0) Or _
\r
2964 (chkPPTemplate.value = vbChecked And mPPTemplateCount > 0)
\r
2967 Function CheckNumberDocsToAnalyze() As Boolean
\r
2968 On Error GoTo HandleErrors
\r
2969 Dim currentFunctionName As String
\r
2970 currentFunctionName = "CheckNumberDocsToAnalyze"
\r
2972 Set mDocFiles = New CollectedFiles
\r
2974 Dim docSearchTypes As Collection
\r
2975 Set docSearchTypes = New Collection
\r
2977 mbDocCountCurrent = False
\r
2979 SetupDocSearchTypes docSearchTypes
\r
2981 If (cbIgnoreOld.ListIndex = 0) Then
\r
2983 ElseIf (cbIgnoreOld.ListIndex = 1) Then
\r
2989 If Not mDocFiles.Search(rootDir:=getInputDir, FileSpecs:=docSearchTypes, _
\r
2990 IncludeSubdirs:=IIf(chkIncludeSubdirs.value, mbTrue, mbFalse), _
\r
2991 ignoreOld:=IIf(chkIgnoreOld.value, mbTrue, mbFalse), Months:=mIssueLimit) Then
\r
2992 CheckNumberDocsToAnalyze = False
\r
2996 SetDocCountsFromFileSearch mDocFiles
\r
2997 WriteFileDateCountsToLog mDocFiles
\r
2999 'WriteDocsToAnalyzeToLog mDocFiles 'UNCOMMENT Recovery - want to list out files to analyze
\r
3001 mbDocCountCurrent = True
\r
3003 lblNumDocs.Caption = ReplaceTopicTokens(GetResString(ANALYZE_DOCUMENTS_ID), TOPIC_STR, _
\r
3004 CStr(mWordDocCount))
\r
3005 lblNumTemplates.Caption = ReplaceTopicTokens(GetResString(ANALYZE_TEMPLATES_ID), TOPIC_STR, _
\r
3006 CStr(mWordTemplateCount))
\r
3008 lblNumXLS.Caption = ReplaceTopicTokens(GetResString(ANALYZE_DOCUMENTS_XLS_ID), TOPIC_STR, _
\r
3009 CStr(mExcelDocCount))
\r
3010 lblNumXLT.Caption = ReplaceTopicTokens(GetResString(ANALYZE_TEMPLATES_ID), TOPIC_STR, _
\r
3011 CStr(mExcelTemplateCount))
\r
3013 lblNumPPT.Caption = ReplaceTopicTokens(GetResString(ANALYZE_DOCUMENTS_PPT_ID), TOPIC_STR, _
\r
3014 CStr(mPPDocCount))
\r
3015 lblNumPOT.Caption = ReplaceTopicTokens(GetResString(ANALYZE_TEMPLATES_ID), TOPIC_STR, _
\r
3016 CStr(mPPTemplateCount))
\r
3018 lblTotalNumDocs.Caption = ReplaceTopicTokens(GetResString(ANALYZE_TOTAL_NUM_DOCS_ID), TOPIC_STR, _
\r
3019 CStr(mTotalDocCount))
\r
3021 If (mIgnoredDocCount > 0) Then
\r
3022 lblSkippedOld.Caption = ReplaceTopicTokens(GetResString(RID_STR_ENG_ANALYZE_IGNORED_DOCS_ID), _
\r
3023 TOPIC_STR, CStr(mIgnoredDocCount))
\r
3024 lblSkippedOld.Visible = True
\r
3026 lblSkippedOld.Visible = False
\r
3029 CheckNumberDocsToAnalyze = True
\r
3032 Set docSearchTypes = Nothing
\r
3036 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3040 Sub SetDocCountsFromFileSearch(myDocFiles As CollectedFiles)
\r
3041 'No Error handling required
\r
3042 mWordDocCount = myDocFiles.DocCount
\r
3043 mWordTemplateCount = myDocFiles.DotCount
\r
3044 mExcelDocCount = myDocFiles.XlsCount
\r
3045 mExcelTemplateCount = myDocFiles.XltCount
\r
3046 mPPDocCount = myDocFiles.PptCount
\r
3047 mPPTemplateCount = myDocFiles.PotCount
\r
3048 mTotalDocCount = mWordDocCount + mWordTemplateCount + mExcelDocCount + mExcelTemplateCount + _
\r
3049 mPPDocCount + mPPTemplateCount
\r
3050 mIgnoredDocCount = myDocFiles.IgnoredDocCount
\r
3053 Sub SetupDocSearchTypes(docSearchTypes As Collection)
\r
3054 'No Error handling required
\r
3055 If chkWordDoc.value Then docSearchTypes.add ("*.doc")
\r
3056 If chkWordTemplate.value Then docSearchTypes.add ("*.dot")
\r
3057 If chkExcelDoc.value Then docSearchTypes.add ("*.xls")
\r
3058 If chkExcelTemplate.value Then docSearchTypes.add ("*.xlt")
\r
3059 If chkPPDoc.value Then docSearchTypes.add ("*.ppt")
\r
3060 If chkPPTemplate.value Then docSearchTypes.add ("*.pot")
\r
3063 Sub WriteDocsToAnalyzeToLog(myDocFiles As CollectedFiles)
\r
3064 On Error GoTo HandleErrors
\r
3065 Dim currentFunctionName As String
\r
3066 currentFunctionName = "WriteDocsToAnalyzeToLog"
\r
3068 Dim vFileName As Variant
\r
3071 limit = myDocFiles.WordFiles.count
\r
3072 For Index = 1 To limit
\r
3073 vFileName = myDocFiles.WordFiles(Index)
\r
3074 WriteToLog "Doc" & Index, CStr(vFileName), section:=(WIZARD_NAME & "ListFor" & CAPPNAME_WORD)
\r
3076 limit = myDocFiles.ExcelFiles.count
\r
3077 For Index = 1 To limit
\r
3078 vFileName = myDocFiles.ExcelFiles(Index)
\r
3079 WriteToLog "Doc" & Index, CStr(vFileName), section:=(WIZARD_NAME & "ListFor" & CAPPNAME_EXCEL)
\r
3081 limit = myDocFiles.PowerPointFiles.count
\r
3082 For Index = 1 To limit
\r
3083 vFileName = myDocFiles.PowerPointFiles(Index)
\r
3084 WriteToLog "Doc" & Index, CStr(vFileName), section:=(WIZARD_NAME & "ListFor" & CAPPNAME_POWERPOINT)
\r
3090 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3094 Sub WriteFileDateCountsToLog(myDocFiles As CollectedFiles)
\r
3095 On Error GoTo HandleErrors
\r
3096 Dim currentFunctionName As String
\r
3097 currentFunctionName = "WriteFileDateCountsToLog"
\r
3099 WriteToLog C_DOCS_LESS_3_MONTH, CStr(myDocFiles.DocsLessThan3Months), mIniFilePath
\r
3100 WriteToLog C_DOCS_LESS_6_MONTH, CStr(myDocFiles.DocsLessThan6Months), mIniFilePath
\r
3101 WriteToLog C_DOCS_LESS_12_MONTH, CStr(myDocFiles.DocsLessThan12Months), mIniFilePath
\r
3102 WriteToLog C_DOCS_MORE_12_MONTH, CStr(myDocFiles.DocsMoreThan12Months), mIniFilePath
\r
3107 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3112 Function RunWordAnalysis(resultsTemplate As String, logFile As String, fsObject As FileSystemObject) As Boolean
\r
3113 On Error GoTo HandleErrors
\r
3114 Dim currentFunctionName As String
\r
3115 currentFunctionName = "RunWordAnalysis"
\r
3116 Const APP_WORD = "Word"
\r
3121 Dim wrd As Word.application
\r
3122 Dim aDoc As Word.Document
\r
3123 Dim sWordDriverDocPath As String
\r
3124 Dim RegValue As Long
\r
3126 If (chkWordDoc.value <> vbChecked) And (chkWordTemplate.value <> vbChecked) Then
\r
3127 'No Word doc filters selected
\r
3128 RunWordAnalysis = True
\r
3132 sWordDriverDocPath = fsObject.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CWORD_DRIVER_FILE)
\r
3133 If Not fsObject.FileExists(sWordDriverDocPath) Then
\r
3134 str = ReplaceTopic2Tokens(GetResString(ERR_MISSING_WORD_DRIVER), _
\r
3135 TOPIC_STR, sWordDriverDocPath, CR_STR, Chr(13))
\r
3137 MsgBox str, vbCritical
\r
3142 Set wrd = New Word.application
\r
3143 If val(wrd.Version) < CSUPPORTED_VERSION Then
\r
3144 str = ReplaceTopic2Tokens(GetResString(ERR_SUPPORTED_VERSION), _
\r
3145 TOPIC_STR, wrd.Version, CR_STR, Chr(13))
\r
3147 MsgBox str, vbCritical
\r
3152 If Not CheckForAccesToWordVBProject(wrd) Then
\r
3154 If Not GiveAccessToMacroProject(APP_WORD, wrd.Version, RegValue) Then
\r
3155 Dim Style, response
\r
3156 str = ReplaceTopic2Tokens(GetResString(ERR_NO_ACCESS_TO_VBPROJECT), _
\r
3157 TOPIC_STR, CAPPNAME_WORD, CR_STR, Chr(13))
\r
3159 Style = vbYesNo + vbQuestion + vbDefaultButton1
\r
3161 response = MsgBox(str, Style)
\r
3162 If response <> vbYes Then
\r
3169 Set aDoc = wrd.Documents.Open(fileName:=sWordDriverDocPath)
\r
3170 'Clear out any doc vars
\r
3171 Dim MyObj As Variable
\r
3172 For Each MyObj In aDoc.Variables
\r
3176 'Setup Input Variables
\r
3177 'SetupInputVariables resultsTemplate, logFile, fsObject, CAPPNAME_WORD
\r
3179 wrd.Run ("AnalysisTool.AnalysisDriver.AnalyseDirectory")
\r
3181 wrd.Visible = False
\r
3185 If RegValue <> -1 Then
\r
3186 SetDefaultRegValue APP_WORD, wrd.Version, RegValue
\r
3188 If RegValue = 0 Then
\r
3189 DeleteRegValue APP_WORD, wrd.Version
\r
3191 If Not aDoc Is Nothing Then aDoc.Close (False)
\r
3192 Set aDoc = Nothing
\r
3194 If Not wrd Is Nothing Then wrd.Quit (False)
\r
3197 RunWordAnalysis = bSuccess
\r
3201 On Error Resume Next
\r
3204 Set aDoc = Nothing
\r
3207 Dim failedDoc As String
\r
3209 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3211 failedDoc = GetDebug(CAPPNAME_WORD, CANALYZING)
\r
3212 If failedDoc = "" Or failedDoc = CSTR_ANALYSIS_LOG_DONE Then
\r
3213 str = ReplaceTopic2Tokens(GetResString(ERR_AUTOMATION_FAILURE), _
\r
3214 TOPIC_STR, CAPPNAME_WORD, CR_STR, Chr(13))
\r
3216 str = ReplaceTopic2Tokens(GetResString(ERR_WORD_DRIVER_CRASH), _
\r
3217 TOPIC_STR, failedDoc, CR_STR, Chr(13))
\r
3221 MsgBox str, vbCritical
\r
3226 Function stripLastBackslash(inputStr As String) As String
\r
3227 Const MIN_DIR_SIZE = 3
\r
3228 On Error GoTo HandleErrors
\r
3229 Dim currentFunctionName As String
\r
3230 currentFunctionName = "stripLastBackslash"
\r
3232 If Len(inputStr) > MIN_DIR_SIZE Then
\r
3233 Dim lastStrChar As String
\r
3234 lastStrChar = Right(inputStr, 1)
\r
3235 If lastStrChar = "\" Then
\r
3236 inputStr = Left(inputStr, Len(inputStr) - 1)
\r
3239 stripLastBackslash = inputStr
\r
3244 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3245 stripLastBackslash = inputStr
\r
3248 Function getInputDir() As String
\r
3249 getInputDir = stripLastBackslash(txtInputDir.Text)
\r
3252 Function getOutputDir() As String
\r
3253 Dim tmpStr As String
\r
3255 tmpStr = stripLastBackslash(txtOutputDir.Text)
\r
3257 'Bug when specifying C:\
\r
3258 If tmpStr <> "" Then
\r
3259 If Right(tmpStr, 1) = "\" Then
\r
3260 tmpStr = Left(tmpStr, Len(tmpStr) - 1)
\r
3263 getOutputDir = tmpStr
\r
3266 Function CheckCreateNewResultsFile(fsObject As FileSystemObject) As Boolean
\r
3267 If Not fsObject.FileExists(getOutputDir & "\" & txtResultsName.Text) Then
\r
3268 'No Results File - Create it
\r
3269 CheckCreateNewResultsFile = True
\r
3270 ElseIf rdbResultsAppend.value Then
\r
3271 'Results File exists and user wants to append to it
\r
3272 CheckCreateNewResultsFile = False
\r
3274 'Results File exists and user has elected not to append
\r
3275 CheckCreateNewResultsFile = True
\r
3279 Sub DeleteFile(file As String)
\r
3280 On Error GoTo HandleErrors
\r
3281 Dim currentFunctionName As String
\r
3282 currentFunctionName = "DeleteFile"
\r
3283 Dim fso As Scripting.FileSystemObject
\r
3284 Set fso = New Scripting.FileSystemObject
\r
3285 Dim filePath As String
\r
3287 filePath = fso.GetAbsolutePathName(file)
\r
3288 If fso.FileExists(filePath) Then
\r
3289 fso.DeleteFile filePath, True
\r
3297 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3301 Public Property Get Version() As String
\r
3302 Version = app.Major & "." & app.Minor & "." & app.Revision
\r
3305 Function GetExcelInstance() As Excel.application
\r
3306 Dim xl As Excel.application
\r
3307 On Error Resume Next
\r
3308 'Try and get an existing instance
\r
3309 Set xl = GetObject(, "Excel.Application")
\r
3310 If Err.Number = 429 Then
\r
3311 Set xl = CreateObject("Excel.Application")
\r
3312 ElseIf Err.Number <> 0 Then
\r
3314 MsgBox "Error: " & Err.Description
\r
3317 Set GetExcelInstance = xl
\r
3321 Function CheckForAnalysisResultsWorkbook(analysisResultsName As String) As Boolean
\r
3322 On Error GoTo HandleErrors
\r
3323 Dim currentFunctionName As String
\r
3324 currentFunctionName = "CheckForAnalysisResultsWorkbook"
\r
3326 CheckForAnalysisResultsWorkbook = False
\r
3328 Dim xl As Excel.application
\r
3329 Set xl = GetExcelInstance
\r
3331 Dim aWb As Excel.Workbook
\r
3332 For Each aWb In xl.Workbooks
\r
3334 If aWb.Name = analysisResultsName Then
\r
3335 CheckForAnalysisResultsWorkbook = True
\r
3341 If Not xl Is Nothing Then
\r
3342 If xl.Workbooks.count = 0 Then
\r
3354 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3358 Function CheckForExcel() As Boolean
\r
3359 On Error GoTo HandleErrors
\r
3360 Dim currentFunctionName As String
\r
3361 currentFunctionName = "CheckForExcel"
\r
3363 CheckForExcel = False
\r
3365 Dim xl As Excel.application
\r
3366 Set xl = GetExcelInstance
\r
3369 If xl.Workbooks.count > 0 Then
\r
3370 CheckForExcel = True
\r
3374 If Not xl Is Nothing Then
\r
3375 If xl.Workbooks.count = 0 Then
\r
3387 WriteDebug currentFunctionName & " : " & Err.Number & " " & Err.Description & " " & Err.Source
\r
3391 Public Function GetIniSetting(key As String) As String
\r
3393 If mIniFilePath = "" Or key = "" Then Exit Function
\r
3395 GetIniSetting = ProfileGetItem(WIZARD_NAME, key, "", mIniFilePath)
\r
3398 Sub WriteIniSetting(key As String, value As String)
\r
3400 If mIniFilePath = "" Or key = "" Then Exit Sub
\r
3402 Call WritePrivateProfileString(WIZARD_NAME, key, value, mIniFilePath)
\r
3405 Private Sub lblSetupComplete_Click(Index As Integer)
\r
3409 Private Function CheckNeededFiles(missingFile As String) As Boolean
\r
3411 Dim fso As New FileSystemObject
\r
3412 Dim filePath As String
\r
3414 CheckNeededFiles = False
\r
3415 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CWORD_DRIVER_FILE)
\r
3416 If Not fso.FileExists(filePath) Then
\r
3417 missingFile = filePath
\r
3421 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CEXCEL_DRIVER_FILE)
\r
3422 If Not fso.FileExists(filePath) Then
\r
3423 missingFile = filePath
\r
3427 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CPP_DRIVER_FILE)
\r
3428 If Not fso.FileExists(filePath) Then
\r
3429 missingFile = filePath
\r
3433 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CLAUNCH_DRIVERS_EXE)
\r
3434 If Not fso.FileExists(filePath) Then
\r
3435 missingFile = filePath
\r
3439 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CMSO_KILL_EXE)
\r
3440 If Not fso.FileExists(filePath) Then
\r
3441 missingFile = filePath
\r
3445 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CRESULTS_TEMPLATE_FILE)
\r
3446 If Not fso.FileExists(filePath) Then
\r
3447 missingFile = filePath
\r
3451 filePath = fso.GetAbsolutePathName(CBASE_RESOURCE_DIR & "\" & CRESOURCE_DLL)
\r
3452 If Not fso.FileExists(filePath) Then
\r
3453 missingFile = filePath
\r
3457 CheckNeededFiles = True
\r