summaryrefslogtreecommitdiff
path: root/wizards/source/importwizard/DialogModul.xba
blob: 0e49a160a3d149d8ea3e35016ddd38e49657b252 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit

Public Const bDebugWizard=True

Public Const SBFIRSTAPPLCHECKED = 0
Public Const SBSECONDAPPLCHECKED = 1
Public Const SBTHIRDAPPLCHECKED = 2
Public Const SBFOURTHAPPLCHECKED = 3
Public WizardMode as String
Public Const SBMICROSOFTMODE = &quot;MS&quot;
Public Const SBXMLMODE = &quot;XML&quot;
&apos; The absolute maximal Number of possible Applications
Public Const Twip = 425
Public Const SBMAXAPPLCOUNT = 4
Public MaxApplCount as Integer
Public CurOffice As Integer
Public SOBitmapPath As String
Public SOWorkPath As String
Public SOTemplatePath as String
Public bCancelTask As Boolean
Public bDoKeepApplValues as Boolean
Public iApplSection as Integer
Public oUcb as Object
Public PathSeparator as String

Public ApplCount as Integer
Public sKeyName(SBMAXAPPLCOUNT-1) as String
Public sValueName(SBMAXAPPLCOUNT-1) as String
Public sCRLF as String
Public MSFilterName(5,2) as String
Public XMLFilterName(7,2)

&apos; e.g.:
&apos; XMLFilterName(x,0) = &quot;sdw&quot; 						&apos; in documents we take the extensions; in SO-templates the appropriate Filtername
&apos; XMLFilterName(x,1) = &quot;swriter: StarWriter 5.0&quot; 	&apos; the filtername of the target-format
&apos; XMLFilterName(x,2) = &quot;sxw&quot; 						&apos; the target extension

Public ChkApplication(SBMAXAPPLCOUNT-1) as Object
Public Applications(SBMAXAPPLCOUNT-1,9)

Public Const SBAPPLCONVERT = 0
Public Const SBDOCCONVERT = 1
Public Const SBDOCRECURSIVE = 2
Public Const SBDOCSOURCE = 3
Public Const SBDOCTARGET = 4
Public Const SBTEMPLCONVERT = 5
Public Const SBTEMPLRECURSIVE = 6
Public Const SBTEMPLSOURCE = 7
Public Const SBTEMPLTARGET = 8
Public Const SBAPPLKEY = 9

&apos; Application-relating Data are stored in this Array
&apos; according to the following structure:
&apos; Applications(X,0) = True/False 		(Application is to be converted)
&apos; Applications(X,1) = True/False 		(Documents are to be converted)
&apos; Applications(X,2) = True/False		(Including Subdirectories)
&apos; Applications(X,3) = &quot;File:///...&quot;		(SourceUrl of the documents)
&apos; Applications(X,4) = &quot;File///:...&quot;		(TargetUrl of the documents)
&apos; Applications(X,5) = True/False		(Templates are to be converted)
&apos; Applications(X,6) = True/False 		(Including Subdirectories)
&apos; Applications(X,7) = &quot;File:///...&quot;		(SourceUrl of the templates)
&apos; Applications(X,8) = &quot;File:///...&quot; 	(TargetUrl of the templates)
&apos; Applications(X,9) = 0					(Key to the original Index of the Applications)


Sub FillStep_Welcome()
Dim i as Integer
&apos;	bDoKeepApplValues = False
	With ImportDialog
		.cbHelp.Label = sHelpButton
		.cbCancel.Label = sCancelButton
		.cbBack.Label = sBackButton
		.cbGoOn.Label = sNextButton
		.WelcomeTextLabel.Label = sWelcomeTextLabel1
		.WelcomeTextLabel2.Label = sWelcomeTextLabel2
		.WelcomeTextLabel3.Label = sWelcomeTextLabel3

		.OptMSDocuments.Label = sContainerName(0)
		.ChkFirstMSApplication.Label = sMsDocumentCheckbox(0)
		.ChkSecondMSApplication.Label = sMsDocumentCheckbox(1)
		.ChkThirdMSApplication.Label = sMsDocumentCheckbox(2)

		.OptSODocuments.Label = sContainerName(1)
		.ChkFirstSOApplication.Label = sSODocumentCheckbox(0)
		.ChkSecondSOApplication.Label = sSODocumentCheckbox(1)
		.ChkThirdSOApplication.Label = sSODocumentCheckbox(2)
		.ChkFourthSOApplication.Label = sSODocumentCheckbox(3)
		.cbBack.Enabled = False
		.Step = 1
	End With
	ToggleNextButton()
End Sub


Sub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean)
Dim Index as Integer
	If bStartup And Not bDoKeepApplValues Then
	    If ImportDialog.OptMSDocuments.State = 1 Then
			SetupMSConfiguration()
		Else
			SetupXMLConfiguration()
		End If
		&apos; TemplateCheckBox-Captions
		GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
		&apos; DocumentCheckbox- Captions
		GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
		AssignCheckboxObjects()
		FillUpApplicationList()
	End If
	CurOffice = OfficeIndex
	Index = Applications(CurOffice,SBAPPLKEY)
	InitializePathsforCurrentApplication(Index)
	With ImportDialog
		.TemplateCheckbox.Label = sTemplateCheckbox(Index)
    	.DocumentPathCheckbox.State = Abs(Applications(CurOffice,SBDOCCONVERT))
		SetEnabledDocument_InputPath()    	
    	.DocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE))
		.DocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
		.DocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
		.hlnDocuments.Label = sProgressMoreDocs

		If WizardMode = SBXMLMODE AND Index = 3 Then
			&apos; Note: SO-Helper Applications are partly treated like templates although they only have documents
			.hlnTemplates.Label = sProgressMoreDocs
			.TemplateCheckbox.Label = sSOHelperDocuments(0)
			.DocumentPathCheckbox.Label = sSOHelperDocuments(1)
		Else
			.TemplateCheckbox.Label = sTemplateCheckbox(Index)
			.DocumentPathCheckbox.Label = sDocumentCheckbox(Index)
			.hlnTemplates.Label = sProgressMoreTemplates
		End If
		.TemplateCheckbox.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
		SetEnabledTemplate_InputPath()
		.TemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE))
		.TemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE))
		.TemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET))
		.cbGoOn.Label = sNextButton
		.cbBack.Enabled = True
		ImportDialog.Step = 2
	End With
	ToggleNextButton()
End Sub


Sub FillUpApplicationList()
Dim i as Integer
Dim a as Integer
Dim BoolValue as Boolean
	If Not bDoKeepApplValues Then
		a = 0
		For i = 0 To ApplCount - 1
			BoolValue = ChkApplication(i).State = 1
			Applications(a,SBAPPLCONVERT) = BoolValue
			Applications(a,SBDOCCONVERT) = BoolValue
			Applications(a,SBDOCRECURSIVE) = BoolValue
			Applications(a,SBDOCSOURCE) = &quot;&quot;			&apos; GetDefaultPath(i)
			Applications(a,SBDOCTARGET) = &quot;&quot;			&apos; SOWorkPath
			Applications(a,SBTEMPLCONVERT) = BoolValue
			Applications(a,SBTEMPLRECURSIVE) = BoolValue
			Applications(a,SBTEMPLSOURCE) = &quot;&quot; 			&apos; GetTemplateDefaultPath(i)
			Applications(a,SBTEMPLTARGET) = &quot;&quot; 			&apos; GetTargetTemplatePath(i)
			Applications(a,SBAPPLKEY) = i
			If ChkApplication(i).State = 1 Then 
				a = a + 1
			End If
		Next i
		ApplCount = a
	End If
End Sub


Sub InitializePathsforCurrentApplication(i as Integer)
	AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i))
	AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath)
	AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i))
	AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i))
End Sub


Sub AssignPathToCurrentApplication(Index as Integer, NewPath as String)
	If Applications(CurOffice,Index) = &quot;&quot; Then
		If CurOffice &gt; 0 Then
			Applications(CurOffice,Index) = Applications(CurOffice-1,Index)
		Else
			Applications(CurOffice,Index) = NewPath
		End If
	End If
End Sub


Sub SaveStep_InputPath()
	Applications(CurOffice,SBDOCCONVERT)  = ImportDialog.DocumentPathCheckbox.State = 1
	Applications(CurOffice,SBDOCRECURSIVE)  = ImportDialog.DocumentSearchSubDir.State = 1
	Applications(CurOffice,SBDOCSOURCE)  = ConvertToURL(ImportDialog.DocumentImportPath.Text)
	Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.DocumentExportPath.Text)
    Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.TemplateCheckbox.State = 1
    Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.TemplateSearchSubDir.State = 1
	Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.TemplateImportPath.Text)
	Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.TemplateExportPath.Text)
End Sub


Sub SetEnabledTemplate_InputPath()
Dim bDoEnable as Boolean
	With ImportDialog
    	bDoEnable = .TemplateCheckbox.State = 1
		.TemplateImportLabel.Enabled = bDoEnable
		.TemplateExportLabel.Enabled = bDoEnable
		.TemplateImportPath.Enabled = bDoEnable
		.TemplateExportPath.Enabled = bDoEnable
		.TemplateSearchSubDir.Enabled = bDoEnable
		.TemplateImportPath.Enabled = bDoEnable
		If Not bDoEnable Then
			.cbGoOn.Enabled = .DocumentPathCheckbox.State = 1
		Else
			.cbGoOn.Enabled = True
		End If
	End With
End Sub


Sub SetEnabledDocument_InputPath()
Dim bDoEnable as Boolean
	With ImportDialog
    	bDoEnable = .DocumentPathCheckbox.State = 1
		.DocumentImportLabel.Enabled = bDoEnable
		.DocumentExportLabel.Enabled = bDoEnable
		.DocumentSearchSubDir.Enabled = bDoEnable
		.DocumentImportPath.Enabled = bDoEnable
		.DocumentExportPath.Enabled = bDoEnable
		If Not bDoEnable Then
			.cbGoOn.Enabled = .TemplateCheckbox.State = 1
		Else
			.cbGoOn.Enabled = True
		End If
	End With
End Sub


Function MakeSummaryString()
Dim sTmpText As String
Dim i as Integer
Dim Index as Integer
Dim sAddText as String
	For i = 0 To ApplCount -1
		Index = Applications(i,SBAPPLKEY)
		If 	Applications(i,SBTEMPLCONVERT) Then
			&apos; Templates are to be converted
			sAddText = &quot;&quot;
			If WizardMode = SBMICROSOFTMODE Then
				sAddText = sSumMSTemplates(Index) &amp; sCRLF
			Else
				sAddText = sSumSOTemplates(Index) &amp; sCRLF			
			End If
			sTmpText = sTmpText &amp; sAddText &amp;  ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) &amp; sCRLF
			If Applications(i,SBTEMPLRECURSIVE) Then
				&apos; Including Subdirectories
				sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
			End If
			sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
			sTmpText = sTmpText &amp; Applications(i,SBTEMPLTARGET) &amp; sCRLF
			sTmpText = sTmpText &amp; sCRLF
		End If

		If Applications(i,SBDOCCONVERT) Then
			&apos; Documents are to be converted
			If WizardMode = SBMICROSOFTMODE Then
				sAddText = sSumMSDocuments(Index) &amp; sCRLF
			Else
				sAddText = sSumSODocuments(Index) &amp; sCRLF			
			End If
			sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBDOCSOURCE)) &amp; sCRLF

			If Applications(i,SBDOCRECURSIVE) Then
				&apos; Including Subdirectories
				sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
			End If

			sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
			sTmpText = sTmpText &amp; Applications(i,SBDOCTARGET) &amp; sCRLF
			sTmpText = sTmpText &amp; sCRLF
		End If
	Next i
	MakeSummaryString = sTmpText
End Function


Sub FillStep_Summary()
&apos; Todo: Angabe über die Vorlagengruppen,bzw. Template-Exportpfad
	With ImportDialog
		.SummaryTextbox.Text = MakeSummaryString()
		.cbGoOn.Enabled = .SummaryTextbox.Text &lt;&gt; &quot;&quot;
		.cbGoOn.Label = sBeginButton
		.SummaryHeaderLabel.Label = sSummaryHeader
		.Step = 3
	End With
End Sub


Sub FillStep_Progress()
	With ImportDialog
		.cbBack.Enabled = False
		.cbGoOn.Enabled = False
	    .hlnProgress.Label = sProgressPage_1
	    .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
   	 	.LabelRetrieval.Label = sProgressPage_2
   	 	.LabelCurProgress.Label = sProgressPage_3
   	 	.LabelCurDocumentRetrieval.Label = &quot;&quot;
   	 	.LabelCurTemplateRetrieval.Label = &quot;&quot;
   		.LabelCurDocument.Label = &quot;&quot;
		.Step = 4
	End With
End Sub


Sub DocumentDirSearchDialog()
	CallDirSearchDialog(ImportDialog.DocumentImportPath)
End Sub


Sub StarDocumentDirSearchDialog()
	CallDirSearchDialog(ImportDialog.DocumentExportPath)
End Sub


Sub CallDirSearchDialog(oTargetControl as Object)
Dim sDirName as String
	sDirName = Application.FileDialog(&quot;P&quot;, sPathDialogMessage, oTargetControl.Text)
	If Len(sDirName) &gt; 0 Then
		oTargetControl.Text = sDirName
	End If
End Sub


Sub	SetupMSConfiguration()
	iApplSection = 0
	Wizardmode = SBMICROSOFTMODE
	MaxApplCount = 3
	ApplCount = 3

	sKeyName(0) = &quot;Software\Microsoft\Office\8.0\Word\Options&quot;
	sKeyName(1) = &quot;Software\Microsoft\Office\8.0\Excel\Microsoft Excel&quot;
	sKeyName(2) = &quot;Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default&quot;

	sValueName(0) = &quot;DOC-PATH&quot;
	sValueName(1) = &quot;DefaultPath&quot;
	sValueName(2) = &quot;&quot;

&apos; See definition of Filtername-Array about meaning of fields
	MSFilterName(0,0) = &quot;doc&quot;
	MSFilterName(0,1) = &quot;swriter: StarOffice XML (Writer)&quot;
	MSFilterName(0,2) = &quot;sxw&quot;

	MSFilterName(1,0) = &quot;xls&quot;
	MSFilterName(1,1) = &quot;scalc: StarOffice XML (Calc)&quot;
	MSFilterName(1,2) = &quot;sxc&quot;

	MSFilterName(2,0) = &quot;pod&quot;
	MSFilterName(2,1) = &quot;simpress: StarOffice XML (Impress)&quot;
	MSFilterName(2,2) = &quot;sxi&quot;

	MSFilterName(3,0) = &quot;dot&quot;
	MSFilterName(3,1) = &quot;swriter: writer_StarOffice_XML_Writer_Template&quot;
	MSFilterName(3,2) = &quot;stw&quot;

	MSFilterName(4,0) = &quot;xlt&quot;
	MSFilterName(4,1) = &quot;scalc: calc_StarOffice_XML_Calc_Template&quot;
	MSFilterName(4,2) = &quot;stc&quot;

	MSFilterName(5,0) = &quot;pot&quot;
	MSFilterName(5,1) = &quot;simpress: impress_StarOffice_XML_Impress_Template&quot;
	MSFilterName(5,2) = &quot;sti&quot;
End Sub



Sub SetupXMLConfiguration()
	iApplSection = 1000
	Wizardmode = SBXMLMODE
	ApplCount = 4
	MaxApplCount = 4

	XMLFilterName(0,0) = &quot;sdw&quot;
	XMLFilterName(0,1) = &quot;swriter: StarOffice XML (Writer)&quot;
	XMLFilterName(0,2) = &quot;sxw&quot;

	XMLFilterName(1,0) = &quot;sdc&quot;
	XMLFilterName(1,1) = &quot;scalc: StarOffice XML (Calc)&quot;
	XMLFilterName(1,2) = &quot;sxc&quot;
&apos; Todo: Gepacktes &apos;sdp&apos; Format berücksichtigen
	XMLFilterName(2,0) = &quot;sdd|sda&quot;
	XMLFilterName(2,1) = &quot;simpress: StarOffice XML (Impress)|sdraw: StarOffice XML (Draw)&quot;
	XMLFilterName(2,2) = &quot;sxi|sxd&quot;

	XMLFilterName(3,0) = &quot;smf&quot;
	XMLFilterName(3,1) = &quot;smath: StarOffice XML (Math)&quot;
	XMLFilterName(3,2) = &quot;sxm&quot;

	XMLFilterName(4,0) = &quot;application/vnd.stardivision.writer;application/vnd.stardivision.writer/web;application/x-starwriter&quot;
	XMLFilterName(4,1) = &quot;swriter: writer_StarOffice_XML_Writer_Template&quot;
	XMLFilterName(4,2) = &quot;stw&quot;

	XMLFilterName(5,0) = &quot;application/vnd.stardivision.calc;application/x-starcalc&quot;
	XMLFilterName(5,1) = &quot;scalc: calc_StarOffice_XML_Calc_Template&quot;
	XMLFilterName(5,2) = &quot;stc&quot;

	XMLFilterName(6,0) = &quot;application/vnd.stardivision.impress;application/x-starimpress|application/vnd.stardivision.draw;application/x-stardraw&quot;
	XMLFilterName(6,1) = &quot;simpress: impress_StarOffice_XML_Impress_Template|draw_StarOffice_XML_Draw_Template&quot;
	XMLFilterName(6,2) = &quot;sti|std&quot;

	XMLFilterName(7,0) = &quot;sgl&quot;
	XMLFilterName(7,1) = &quot;swriter: writer_globaldocument_StarOffice_XML_Writer_GlobalDocument&quot;
	XMLFilterName(7,2) = &quot;sxg&quot;
End Sub


Function CheckControlPath(oTextBox as Object, ByVal bDoEnable as Boolean)
Dim sPath as String
	If Not bDoEnable Then
		CheckControlPath = False
	Else
		sPath = ConvertToUrl(Trim(oTextBox.Text)
		CheckControlPath = oUcb.Exists(sPath)
	End If
End Function


Sub AssignCheckboxObjects()
	With ImportDialog
    	If .OptSODocuments.State = 1 Then
			Set ChkApplication(0) = .ChkFirstSOApplication
			Set ChkApplication(1) = .ChkSecondSOApplication
			Set ChkApplication(2) = .ChkThirdSOApplication
			Set ChkApplication(3) = .ChkFourthSOApplication
		Else
			Set ChkApplication(0) = .ChkFirstMSApplication
			Set ChkApplication(1) = .ChkSecondMSApplication
			Set ChkApplication(2) = .ChkThirdMSApplication
		End If
	End With
End Sub


Function CheckInputPaths() as Boolean
Dim bChangePage as Boolean
	bChangePage = CheckTextBoxPath(ImportDialog.TemplateImportPath, True, False)
	bChangePage = CheckTextBoxPath(ImportDialog.TemplateExportPath, bChangePage, True)
	bChangePage = CheckTextBoxPath(ImportDialog.DocumentImportPath, bChangePage, False)
	bChangePage = CheckTextBoxPath(ImportDialog.DocumentExportPath, bChangePage, True)
	CheckInputPaths = bChangePage
End Function


Function CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean) as Boolean
Dim iCreate as Integer
Dim sQueryMessage as String
Dim sUrlPath as String
Dim sMessageNoDir as String
Dim sShowPath as String
	If oTextBox.Enabled Then
		If bCheck Then
			sShowPath = oTextBox.Text
			sUrlPath = ConvertToUrl(sShowPath)
			If Not oUcb.Exists(sUrlPath) Then
				If Not bCreateNew Then
					&apos; Sourcedirectories must be existing, Targetdirectories may be created new
					sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
					Msgbox(sQueryMessage,16,sTitle)
					CheckTextBoxPath() = False
					Exit Function
				Else
					sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
					sQueryMessage = sQueryMessage &amp; Chr(13) &amp; sQueryForNewCreation
					iCreate = Msgbox (sQueryMessage, 36, sTitle)
					If iCreate = 6 Then
						On Local Error Goto NOVALIDPATH
						oUcb.CreateFolder(sUrlPath)
						If Not oUcb.Exists(sUrlPath) Then
							Goto NOVALIDPATH
						End If
					Else
						CheckTextBoxPath() = False
						Exit Function
					End If
				End If
			End If
			CheckTextBoxPath() = True
		Else
			CheckTextBoxPath() = False
		End If
	Else
		CheckTextBoxPath() = True
	End If
	Exit Function
NOVALIDPATH:
	sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, &quot;%1&quot;)
	Msgbox(sMessageNoDir, 16, sTitle)
	CheckTextBoxPath() = False
End Function


Sub InitializeProgressPage(oDialog as Object)
  &apos;oDialog.LabelRetrieval.Label = &quot;&quot;
  &apos;oDialog.LabelCurProgress.Label = &quot;&quot;
  oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
  oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
End Sub


Sub GetFolderName(aEvent as Object)
Dim oFolderDialog
Dim iAccept as Integer
Dim sPath as String
Dim InitPath as String
Dim RefControlName as String
Dim oRefControl
	oFolderDialog = CreateUnoService(&quot;com.sun.star.ui.dialogs.FolderPicker&quot;)
	RefControlName = aEvent.Source.Model.Tag
	oRefControl = ImportDialogArea.GetControl(RefControlName)
	InitPath = ConvertToUrl(oRefControl.Model.Text)
	If oUcb.Exists(InitPath) Then
		oFolderDialog.SetDisplayDirectory(InitPath)
	End If
	iAccept = oFolderDialog.Execute()
	If iAccept = 1 Then
		sPath = oFolderDialog.GetDisplayDirectory()
		If oUcb.Exists(sPath) Then
			oRefControl.Text = ConvertFromUrl(sPath)
		End If
	End If
End Sub
</script:module>