Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1173 lines
42 KiB

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frmMain
  5. BorderStyle = 1 'Fixed Single
  6. Caption = "Keyword Reporting Utility"
  7. ClientHeight = 5355
  8. ClientLeft = 1575
  9. ClientTop = 1740
  10. ClientWidth = 9810
  11. LinkTopic = "Form1"
  12. MaxButton = 0 'False
  13. MinButton = 0 'False
  14. ScaleHeight = 5355
  15. ScaleWidth = 9810
  16. Begin VB.ComboBox cmbReports
  17. Height = 315
  18. Left = 1200
  19. TabIndex = 3
  20. Top = 495
  21. Width = 4380
  22. End
  23. Begin VB.ComboBox cmbMaxRows
  24. Height = 315
  25. Left = 6855
  26. TabIndex = 4
  27. Top = 495
  28. Width = 1020
  29. End
  30. Begin VB.CommandButton cmdSave
  31. Caption = "..."
  32. Height = 255
  33. Left = 9270
  34. TabIndex = 6
  35. Top = 885
  36. Width = 420
  37. End
  38. Begin VB.TextBox txtSaveReport
  39. Height = 285
  40. Left = 1200
  41. TabIndex = 5
  42. Top = 915
  43. Width = 7950
  44. End
  45. Begin MSComctlLib.ProgressBar prgBar
  46. Height = 240
  47. Left = 15
  48. TabIndex = 11
  49. Top = 4845
  50. Width = 9735
  51. _ExtentX = 17171
  52. _ExtentY = 423
  53. _Version = 393216
  54. Appearance = 1
  55. End
  56. Begin VB.TextBox txtLog
  57. Height = 3120
  58. Left = 0
  59. MultiLine = -1 'True
  60. ScrollBars = 2 'Vertical
  61. TabIndex = 10
  62. Top = 1650
  63. Width = 9720
  64. End
  65. Begin MSComctlLib.StatusBar stbProgress
  66. Align = 2 'Align Bottom
  67. Height = 240
  68. Left = 0
  69. TabIndex = 9
  70. Top = 5115
  71. Width = 9810
  72. _ExtentX = 17304
  73. _ExtentY = 423
  74. Style = 1
  75. _Version = 393216
  76. BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
  77. NumPanels = 1
  78. BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
  79. EndProperty
  80. EndProperty
  81. End
  82. Begin MSComDlg.CommonDialog dlg
  83. Left = 7515
  84. Top = 5100
  85. _ExtentX = 847
  86. _ExtentY = 847
  87. _Version = 393216
  88. End
  89. Begin VB.CommandButton cmdBrowse
  90. Caption = "..."
  91. Height = 255
  92. Left = 9285
  93. TabIndex = 2
  94. Top = 120
  95. Width = 420
  96. End
  97. Begin VB.CommandButton cmdClose
  98. Caption = "&Close"
  99. Height = 375
  100. Left = 8835
  101. TabIndex = 8
  102. Top = 1230
  103. Width = 855
  104. End
  105. Begin VB.CommandButton cmdGo
  106. Caption = "&OK"
  107. Height = 375
  108. Left = 7980
  109. TabIndex = 7
  110. Top = 1230
  111. Width = 855
  112. End
  113. Begin VB.TextBox txtCabFile
  114. Height = 285
  115. Left = 1200
  116. TabIndex = 1
  117. Top = 135
  118. Width = 7935
  119. End
  120. Begin VB.Label Label4
  121. Caption = "Report:"
  122. Height = 330
  123. Left = 105
  124. TabIndex = 14
  125. Top = 435
  126. Width = 1125
  127. End
  128. Begin VB.Label lblMaxRows
  129. Caption = "Max Rows per Spreadsheet:"
  130. Height = 420
  131. Left = 5700
  132. TabIndex = 13
  133. Top = 450
  134. Width = 1125
  135. End
  136. Begin VB.Label Label2
  137. Caption = "Report File:"
  138. Height = 255
  139. Left = 75
  140. TabIndex = 12
  141. Top = 945
  142. Width = 975
  143. End
  144. Begin VB.Label Label1
  145. Caption = "Input CAB:"
  146. Height = 255
  147. Left = 120
  148. TabIndex = 0
  149. Top = 120
  150. Width = 975
  151. End
  152. End
  153. Attribute VB_Name = "frmMain"
  154. Attribute VB_GlobalNameSpace = False
  155. Attribute VB_Creatable = False
  156. Attribute VB_PredeclaredId = True
  157. Attribute VB_Exposed = False
  158. Option Explicit
  159. ' Utility Stuff, all this could go to a COM Object and be distributed
  160. ' like this.
  161. Private m_WsShell As IWshShell ' Used to Shell and Wait for Sub-Processes
  162. Private m_fso As Scripting.FileSystemObject ' For filesystem operations
  163. Private m_fh As Scripting.TextStream
  164. Private m_ProcessingState As ProcessingState
  165. Enum ProcessingState
  166. PROC_PROCESSING = 2 ^ 0
  167. PROC_STOP_PROCESSING_NOW = 2 ^ 2
  168. PROC_PROCESSING_STOPPED = 2 ^ 3
  169. End Enum
  170. Enum ReportList
  171. REP_ALLKW_ALLENTRIES = 0
  172. REP_TAXOENTRIES_NOKW = 1
  173. REP_SAMEURI_DIFFERENT_TITLE = 2
  174. REP_SAMEURI_DIFFERENT_TYPE = 3
  175. REP_SAMETITLE_DIFFERENT_URI = 4
  176. REP_SAMETITLE_DIFFERENT_TYPE = 5
  177. REP_BROKEN_LINKS = 6
  178. REP_DUPLICATE_ENTRIES = 7
  179. End Enum
  180. Private Sub cmbReports_Click()
  181. If (cmbReports.ListIndex = REP_ALLKW_ALLENTRIES) Then
  182. cmbMaxRows.Visible = True
  183. lblMaxRows.Visible = True
  184. Else
  185. cmbMaxRows.Visible = False
  186. lblMaxRows.Visible = False
  187. End If
  188. End Sub
  189. Private Sub Form_Initialize()
  190. Set m_WsShell = CreateObject("Wscript.Shell")
  191. Set m_fso = New Scripting.FileSystemObject
  192. End Sub
  193. Private Sub Form_Load()
  194. Me.Caption = App.EXEName & ": Production Tool Reporting Utility"
  195. WriteLog Me.Caption, False
  196. WriteLog String$(60, "="), False
  197. ' we load the possible Spreadsheet size values for reports that
  198. ' exceed Excels capacity.
  199. cmbMaxRows.AddItem "500"
  200. cmbMaxRows.AddItem "1000"
  201. cmbMaxRows.AddItem "2000"
  202. cmbMaxRows.AddItem "4000"
  203. cmbMaxRows.AddItem "6000"
  204. cmbMaxRows.AddItem "8000"
  205. cmbMaxRows.AddItem "10000"
  206. cmbMaxRows.AddItem "15000"
  207. cmbMaxRows.AddItem "20000"
  208. cmbMaxRows.AddItem "25000"
  209. cmbMaxRows.AddItem "30000"
  210. cmbMaxRows.AddItem "40000"
  211. cmbMaxRows.AddItem "50000"
  212. cmbMaxRows.ListIndex = 7
  213. ' we load the list of possible reports
  214. cmbReports.AddItem "All Keywords on All topics -- long"
  215. cmbReports.AddItem "Taxonomy Entries that have no Keywords"
  216. cmbReports.AddItem "Taxonomy Entries with Same URI but different Title"
  217. cmbReports.AddItem "Taxonomy Entries with Same URI but different Content Type"
  218. cmbReports.AddItem "Taxonomy Entries with Same Title but different URI"
  219. cmbReports.AddItem "Taxonomy Entries with Same Title but different Content Type"
  220. cmbReports.AddItem "Taxonomy Entries with broken links"
  221. cmbReports.AddItem "Taxonomy Entries that are duplicates"
  222. cmbReports.ListIndex = 1
  223. cmdGo.Default = True
  224. cmdClose.Cancel = True
  225. ' If (Len(Trim$(Command$)) > 0) Then
  226. ' Me.txtCabFile = Command$
  227. ' Me.Show Modal:=False
  228. ' cmdGo_Click
  229. ' cmdClose_Click
  230. ' End If
  231. End Sub
  232. Function Cab2Folder(ByVal strCabFile As String)
  233. Cab2Folder = ""
  234. ' We grab a Temporary Filename and create a folder out of it
  235. Dim strFolder As String
  236. strFolder = m_fso.GetSpecialFolder(TemporaryFolder) + "\" + m_fso.GetTempName
  237. m_fso.CreateFolder strFolder
  238. ' We uncab CAB contents into the Source CAB Contents dir.
  239. Dim strCmd As String
  240. strCmd = "cabarc X " + strCabFile + " " + strFolder + "\"
  241. m_WsShell.Run strCmd, True, True
  242. Cab2Folder = strFolder
  243. End Function
  244. Sub WriteLog(strMsg As String, Optional ByVal bWriteToStatusBar As Boolean = True)
  245. With Me
  246. .txtLog = .txtLog & vbCrLf & strMsg
  247. If (bWriteToStatusBar) Then
  248. .stbProgress.SimpleText = strMsg
  249. End If
  250. End With
  251. DoEvents
  252. End Sub
  253. Private Function p_getTemplateName(ByVal strFolder As String) As String
  254. Dim strExt As String: strExt = ".csv"
  255. Dim strCandidateFileName As String
  256. strCandidateFileName = strFolder + "\" + cmbReports.Text + strExt
  257. Dim lx As Long: lx = 2
  258. Do While (m_fso.FileExists(strCandidateFileName))
  259. strCandidateFileName = strFolder & "\" & cmbReports.Text & "_" & lx & strExt
  260. lx = lx + 1
  261. Loop
  262. p_getTemplateName = m_fso.GetFileName(strCandidateFileName)
  263. End Function
  264. ' ============ END UTILITY STUFF ========================
  265. ' ============ BoilerPlate Form Code
  266. Private Sub cmdBrowse_Click()
  267. dlg.Filter = "All Files (*.*)|*.*|Cab Files (*.cab)|*.cab"
  268. dlg.FilterIndex = 2
  269. dlg.ShowOpen
  270. If (Len(dlg.FileName) > 0) Then
  271. Me.txtCabFile = dlg.FileName
  272. End If
  273. End Sub
  274. Private Sub cmdSave_Click()
  275. dlg.Filter = "All Files (*.*)|*.*|Text Files (*.csv)|*.csv"
  276. dlg.FilterIndex = 2
  277. dlg.FileName = p_getTemplateName(m_fso.GetParentFolderName(dlg.FileName))
  278. dlg.ShowSave
  279. If (Len(dlg.FileName) > 0) Then
  280. Me.txtSaveReport = dlg.FileName
  281. End If
  282. End Sub
  283. Private Sub cmdClose_Click()
  284. If (m_ProcessingState = PROC_PROCESSING) Then
  285. m_ProcessingState = PROC_STOP_PROCESSING_NOW
  286. Else
  287. Unload Me
  288. End If
  289. End Sub
  290. Private Sub cmdGo_Click()
  291. With Me
  292. .txtCabFile.Text = Trim$(Me.txtCabFile.Text)
  293. If (Len(.txtCabFile.Text) = 0 Or _
  294. LCase$(m_fso.GetExtensionName(.txtCabFile.Text)) <> "cab") Then
  295. MsgBox "You must specify a valid CAB File created by the HSC Production" + _
  296. " tool in order to create a report"
  297. GoTo Common_Exit
  298. End If
  299. .txtSaveReport.Text = Trim$(Me.txtSaveReport.Text)
  300. If (Len(.txtSaveReport.Text) = 0) Then
  301. MsgBox "You must Specify an output report file"
  302. GoTo Common_Exit
  303. End If
  304. SetRunningState True
  305. FixCab .txtCabFile.Text, .txtSaveReport.Text
  306. SetRunningState False
  307. End With
  308. Common_Exit:
  309. End Sub
  310. Private Sub SetRunningState(ByVal bRunning As Boolean)
  311. With Me
  312. .cmdGo.Enabled = Not bRunning
  313. .cmdBrowse.Enabled = Not bRunning
  314. .cmdSave.Enabled = Not bRunning
  315. .cmbMaxRows.Enabled = Not bRunning
  316. .cmbMaxRows.Enabled = Not bRunning
  317. .txtCabFile.Enabled = Not bRunning
  318. .txtSaveReport.Enabled = Not bRunning
  319. If (bRunning) Then
  320. .cmdClose.Caption = "&Stop"
  321. Else
  322. .cmdClose.Caption = "&Close"
  323. End If
  324. End With
  325. End Sub
  326. Sub FixCab(ByVal strCabFile As String, ByVal strSaveCab As String)
  327. Dim strErrMsg As String: strErrMsg = ""
  328. If (Not m_fso.FileExists(strCabFile)) Then
  329. MsgBox "Cannot find " & strCabFile
  330. GoTo Common_Exit
  331. End If
  332. Dim strCabFolder As String
  333. prgBar.Visible = True
  334. WriteLog "Uncabbing " & strCabFile
  335. strCabFolder = Cab2Folder(strCabFile)
  336. WriteLog "Running Report "
  337. Dim bSuccess As Boolean
  338. Select Case cmbReports.ListIndex
  339. Case REP_ALLKW_ALLENTRIES
  340. bSuccess = RepAllKwEntries(strCabFolder)
  341. Case REP_TAXOENTRIES_NOKW
  342. bSuccess = RepTaxoEntriesNoKw(strCabFolder)
  343. Case REP_SAMEURI_DIFFERENT_TITLE
  344. bSuccess = RepTaxoEntriesSameUriDifferentTitle(strCabFolder)
  345. Case REP_SAMEURI_DIFFERENT_TYPE
  346. bSuccess = RepSameUriDifferentContentTypes(strCabFolder)
  347. Case REP_SAMETITLE_DIFFERENT_URI
  348. bSuccess = RepTaxoEntriesSameTitleDifferentUri(strCabFolder)
  349. Case REP_SAMETITLE_DIFFERENT_TYPE
  350. bSuccess = RepSameTitleDifferentContentTypes(strCabFolder)
  351. Case REP_BROKEN_LINKS
  352. bSuccess = RepBrokenLinks(strCabFolder)
  353. Case REP_DUPLICATE_ENTRIES
  354. bSuccess = RepDuplicates(strCabFolder)
  355. End Select
  356. If (bSuccess) Then
  357. WriteLog "Finished Report on " & strCabFile
  358. Else
  359. WriteLog "Error, Report Failed"
  360. End If
  361. ' Now we delete the Temporary Folders
  362. WriteLog "Deleting Temporary Files"
  363. m_fso.DeleteFolder strCabFolder, force:=True
  364. Common_Exit:
  365. WriteLog "Done" + IIf(Len(strErrMsg) > 0, " - " + strErrMsg, "")
  366. prgBar.Visible = False
  367. End Sub
  368. ' ========================================================
  369. ' Utility functions to get at different places in the
  370. ' package_description.xml and HHT files
  371. ' ========================================================
  372. Private Function GetPackage(ByVal strCabFolder As String) As DOMDocument
  373. Set GetPackage = Nothing
  374. Dim oDomPkg As DOMDocument: Set oDomPkg = New DOMDocument
  375. Dim strPkgFile As String: strPkgFile = strCabFolder + "\package_description.xml"
  376. oDomPkg.async = False
  377. oDomPkg.Load strPkgFile
  378. If (oDomPkg.parseError <> 0) Then
  379. p_DisplayParseError oDomPkg.parseError
  380. GoTo Common_Exit
  381. End If
  382. Set GetPackage = oDomPkg
  383. Common_Exit:
  384. End Function
  385. Private Function p_GetHht( _
  386. ByRef oDomHhtNode As IXMLDOMNode, _
  387. ByVal strCabFolder As String, _
  388. Optional ByRef strHhtFile As String = "" _
  389. ) As IXMLDOMNode
  390. Set p_GetHht = Nothing
  391. If (oDomHhtNode Is Nothing) Then GoTo Common_Exit
  392. strHhtFile = oDomHhtNode.Attributes.getNamedItem("FILE").Text
  393. ' Let's load the HHT
  394. Dim oDomHht As DOMDocument: Set oDomHht = New DOMDocument
  395. oDomHht.async = False
  396. oDomHht.Load strCabFolder + "\" + strHhtFile
  397. If (oDomHht.parseError <> 0) Then
  398. p_DisplayParseError oDomHht.parseError
  399. GoTo Common_Exit
  400. End If
  401. Set p_GetHht = oDomHht
  402. Common_Exit:
  403. End Function
  404. Private Function p_GetAttribute(ByRef oNode As IXMLDOMNode, ByRef strAttrib As String) As String
  405. p_GetAttribute = ""
  406. Dim oAttrib As IXMLDOMAttribute
  407. Set oAttrib = oNode.Attributes.getNamedItem(strAttrib)
  408. If (Not oAttrib Is Nothing) Then
  409. p_GetAttribute = oAttrib.Value
  410. End If
  411. Common_Exit:
  412. End Function
  413. ' ========================================================
  414. ' ============= End BoilerPlate Form Code ================
  415. ' ========================================================
  416. Function RepAllKwEntries(ByVal strCabFolder As String) As Boolean
  417. RepAllKwEntries = False
  418. ' Now we parse Package_Description.xml to find the HHT Files
  419. Dim oElem As IXMLDOMElement ' Used for all element Creation
  420. Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  421. WriteLog "Processing Report for: " + _
  422. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  423. " [ " + _
  424. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  425. " ]"
  426. Dim lTaxoInEntries As Long: lTaxoInEntries = 0
  427. Dim oMetadataNode As IXMLDOMNode
  428. Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  429. Dim oDOMNode As IXMLDOMNode
  430. Dim oDomHhtNode As IXMLDOMNode
  431. For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  432. Dim strHhtFile As String
  433. strHhtFile = oDomHhtNode.Attributes.getNamedItem("FILE").Text
  434. ' Let's load the HHT
  435. Dim oDomHht As DOMDocument: Set oDomHht = New DOMDocument
  436. oDomHht.async = False
  437. oDomHht.Load strCabFolder + "\" + strHhtFile
  438. If (oDomHht.parseError <> 0) Then
  439. p_DisplayParseError oDomHht.parseError
  440. GoTo Common_Exit
  441. End If
  442. p_CreateReport oDomHht.selectSingleNode("METADATA/TAXONOMY_ENTRIES")
  443. Next
  444. RepAllKwEntries = True
  445. Common_Exit:
  446. Exit Function
  447. End Function
  448. Private Sub p_CreateReport(ByRef oDOMNode As IXMLDOMNode)
  449. Dim oTaxoEntry As IXMLDOMNode, oKwList As IXMLDOMNodeList, oKwEntry As IXMLDOMNode
  450. Dim lEntry As Long: lEntry = 0
  451. m_ProcessingState = PROC_PROCESSING
  452. prgBar.Max = oDOMNode.childNodes.length
  453. prgBar.Value = 0
  454. Dim strTitle As String, strCategory As String, strURI As String
  455. Dim strChunk As String, strOutputFile As String
  456. Dim lFileIndex As Long: lFileIndex = 1
  457. Dim lMaxRows As Long: lMaxRows = CLng(Me.cmbMaxRows.Text)
  458. WriteLog "Rows per Spreadsheet: " & lMaxRows
  459. strOutputFile = Me.txtSaveReport
  460. Dim lNumRows As Long: lNumRows = oDOMNode.selectNodes("//KEYWORD").length
  461. WriteLog "Total Number of Keyword Entries (1 Keyword = 1 Spreadsheet row): " & lNumRows
  462. WriteLog "Number of Spreadsheets to be created: " & (lNumRows \ lMaxRows) + 1, False
  463. lNumRows = 0
  464. WriteLog "Creating output file: " & strOutputFile
  465. Set m_fh = m_fso.CreateTextFile(strOutputFile, overwrite:=True, Unicode:=True)
  466. m_fh.WriteLine """Title""" + vbTab + """Keyword""" + vbTab + """URI""" + vbTab + _
  467. """Category"""
  468. Dim oAttrib As IXMLDOMAttribute
  469. For Each oTaxoEntry In oDOMNode.childNodes
  470. If (m_ProcessingState = PROC_STOP_PROCESSING_NOW) Then GoTo Common_Exit
  471. lEntry = lEntry + 1
  472. prgBar.Value = lEntry
  473. stbProgress.SimpleText = "Processing Taxonomy Entry: " & lEntry
  474. strTitle = oTaxoEntry.Attributes.getNamedItem("TITLE").Text
  475. strCategory = oTaxoEntry.Attributes.getNamedItem("CATEGORY").Text
  476. Set oAttrib = oTaxoEntry.Attributes.getNamedItem("URI")
  477. If (Not oAttrib Is Nothing) Then
  478. strURI = oAttrib.Text
  479. Else
  480. strURI = ""
  481. End If
  482. strChunk = vbTab + """" + strURI + """" + vbTab + """" + strCategory + """"
  483. Set oKwList = oTaxoEntry.selectNodes("./KEYWORD")
  484. If (Not oKwList Is Nothing) Then
  485. For Each oKwEntry In oKwList
  486. ' WriteLog vbTab & oKwEntry.Text, False
  487. lNumRows = lNumRows + 1
  488. m_fh.WriteLine """" + strTitle + """" + vbTab + """" + oKwEntry.Text + """" + _
  489. strChunk
  490. Next
  491. End If
  492. DoEvents
  493. If (lNumRows > lMaxRows) Then
  494. m_fh.Close
  495. lFileIndex = lFileIndex + 1
  496. strOutputFile = m_fso.GetParentFolderName(Me.txtSaveReport) & "\" & _
  497. m_fso.GetBaseName(Me.txtSaveReport) & "_" & lFileIndex & "." & _
  498. m_fso.GetExtensionName(Me.txtSaveReport)
  499. WriteLog "Creating output file: " & strOutputFile
  500. Set m_fh = m_fso.CreateTextFile(strOutputFile, overwrite:=True, Unicode:=True)
  501. m_fh.WriteLine """Title""" + vbTab + """Keyword""" + vbTab + """URI""" + vbTab + _
  502. """Category"""
  503. lNumRows = 0
  504. End If
  505. Next
  506. Common_Exit:
  507. m_fh.Close: Set m_fh = Nothing
  508. m_ProcessingState = PROC_PROCESSING_STOPPED
  509. End Sub
  510. Function RepTaxoEntriesNoKw(ByVal strCabFolder As String) As Boolean
  511. RepTaxoEntriesNoKw = False
  512. Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  513. WriteLog "Processing Report for: " + _
  514. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  515. " [ " + _
  516. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  517. " ]"
  518. Dim lTotalTaxoEntriesNoKw As Long: lTotalTaxoEntriesNoKw = 0
  519. ' Now we parse Package_Description.xml to find the HHT Files
  520. Dim oMetadataNode As IXMLDOMNode
  521. Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  522. ' We create the output report File
  523. Set m_fh = m_fso.CreateTextFile(Me.txtSaveReport, overwrite:=True, Unicode:=True)
  524. m_fh.WriteLine """Title""" + vbTab + """Category""" + vbTab + """URI""" + vbTab + """HHT File"""
  525. Dim oDOMNode As IXMLDOMNode
  526. Dim oDomHhtNode As IXMLDOMNode
  527. Dim oDomHht As DOMDocument
  528. Dim strHhtFile As String
  529. For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  530. ' Let's load the HHT
  531. Set oDomHht = p_GetHht(oDomHhtNode, strCabFolder, strHhtFile)
  532. Dim oNodeNoKwList As IXMLDOMNodeList
  533. oDomHht.setProperty "SelectionLanguage", "XPath"
  534. Set oNodeNoKwList = oDomHht.selectNodes("/METADATA/TAXONOMY_ENTRIES//TAXONOMY_ENTRY[ not( KEYWORD ) and string-length( @URI ) > 0 ]")
  535. Dim lTaxoEntriesNoKw As Long: lTaxoEntriesNoKw = oNodeNoKwList.length
  536. WriteLog strHhtFile & ": There are " & lTaxoEntriesNoKw & " taxonomy Entries with NO Keywords"
  537. lTotalTaxoEntriesNoKw = lTotalTaxoEntriesNoKw + lTaxoEntriesNoKw
  538. prgBar.Max = lTaxoEntriesNoKw + 1
  539. prgBar.Value = 1
  540. Dim oTaxoEntryNoKw As IXMLDOMNode
  541. For Each oTaxoEntryNoKw In oNodeNoKwList
  542. Dim strTitle As String, strCategory As String, strURI As String
  543. Dim oAttrib As IXMLDOMAttribute
  544. strTitle = p_GetAttribute(oTaxoEntryNoKw, "TITLE")
  545. strCategory = p_GetAttribute(oTaxoEntryNoKw, "CATEGORY")
  546. strURI = p_GetAttribute(oTaxoEntryNoKw, "URI")
  547. m_fh.WriteLine """" + strTitle + """" + vbTab + _
  548. """" + strCategory + """" + vbTab + _
  549. """" + strURI + """" + vbTab + _
  550. """" + strHhtFile + """"
  551. prgBar.Value = prgBar.Value + 1
  552. Next
  553. Next
  554. WriteLog "Total : There are " & lTotalTaxoEntriesNoKw & " taxonomy Entries with NO Keywords"
  555. RepTaxoEntriesNoKw = True
  556. Common_Exit:
  557. If (Not m_fh Is Nothing) Then m_fh.Close: Set m_fh = Nothing
  558. Exit Function
  559. End Function
  560. Function RepBrokenLinks(ByVal strCabFolder As String) As Boolean
  561. RepBrokenLinks = False
  562. Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  563. WriteLog "Processing Report for: " + _
  564. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  565. " [ " + _
  566. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  567. " ]"
  568. Dim lTotalBrokenLinks As Long: lTotalBrokenLinks = 0
  569. ' Now we parse Package_Description.xml to find the HHT Files
  570. Dim oMetadataNode As IXMLDOMNode
  571. Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  572. ' We create the output report File
  573. Set m_fh = m_fso.CreateTextFile(Me.txtSaveReport, overwrite:=True, Unicode:=True)
  574. m_fh.WriteLine """Title""" + vbTab + """Category""" + vbTab + """URI""" + vbTab + """HHT File"""
  575. Dim oDOMNode As IXMLDOMNode
  576. Dim oDomHhtNode As IXMLDOMNode
  577. Dim oDomHht As DOMDocument
  578. Dim oDomTaxonomyEntries As IXMLDOMNode
  579. Dim strHhtFile As String
  580. Dim strSKU As String
  581. Dim strBrokenLinkDir As String
  582. strSKU = p_GetAttribute(oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU"), "VALUE")
  583. Select Case strSKU
  584. Case "Personal_32"
  585. strBrokenLinkDir = "\\vbaliga4\public\helpdirs\per\"
  586. Case "Professional_32"
  587. strBrokenLinkDir = "\\vbaliga4\public\helpdirs\pro\"
  588. Case "Professional_64"
  589. strBrokenLinkDir = "\\vbaliga4\public\helpdirs\pro64\"
  590. End Select
  591. For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  592. ' Let's load the HHT
  593. Set oDomHht = p_GetHht(oDomHhtNode, strCabFolder, strHhtFile)
  594. Set oDomTaxonomyEntries = oDomHht.selectSingleNode("METADATA/TAXONOMY_ENTRIES")
  595. Dim lBrokenLinks As Long: lBrokenLinks = 0
  596. prgBar.Max = oDomTaxonomyEntries.childNodes.length + 1
  597. prgBar.Value = 1
  598. Dim oTaxoEntry As IXMLDOMNode
  599. For Each oTaxoEntry In oDomTaxonomyEntries.childNodes
  600. Dim strTitle As String, strCategory As String, strURI As String, strNewURI As String
  601. Dim oAttrib As IXMLDOMAttribute
  602. strTitle = p_GetAttribute(oTaxoEntry, "TITLE")
  603. strCategory = p_GetAttribute(oTaxoEntry, "CATEGORY")
  604. strURI = p_GetAttribute(oTaxoEntry, "URI")
  605. If (Not LinkValid(strBrokenLinkDir, "", strURI, strNewURI)) Then
  606. m_fh.WriteLine """" + strTitle + """" + vbTab + _
  607. """" + strCategory + """" + vbTab + _
  608. """" + strURI + """" + vbTab + _
  609. """" + strHhtFile + """"
  610. lBrokenLinks = lBrokenLinks + 1
  611. End If
  612. prgBar.Value = prgBar.Value + 1
  613. Next
  614. lTotalBrokenLinks = lTotalBrokenLinks + lBrokenLinks
  615. WriteLog strHhtFile & ": There are " & lBrokenLinks & " broken links"
  616. Next
  617. WriteLog "Total : There are " & lTotalBrokenLinks & " taxonomy Entries with Broken links"
  618. RepBrokenLinks = True
  619. Common_Exit:
  620. If (Not m_fh Is Nothing) Then m_fh.Close: Set m_fh = Nothing
  621. Exit Function
  622. End Function
  623. Function RepDuplicates(ByVal strCabFolder As String) As Boolean
  624. RepDuplicates = False
  625. Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  626. WriteLog "Processing Report for: " + _
  627. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  628. " [ " + _
  629. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  630. " ]"
  631. Dim lTotalDuplicates As Long: lTotalDuplicates = 0
  632. ' Now we parse Package_Description.xml to find the HHT Files
  633. Dim oMetadataNode As IXMLDOMNode
  634. Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  635. ' We create the output report File
  636. Set m_fh = m_fso.CreateTextFile(Me.txtSaveReport, overwrite:=True, Unicode:=True)
  637. m_fh.WriteLine """Title""" + vbTab + """Category""" + vbTab + """URI""" + vbTab + """Entry""" + vbTab + """HHT File"""
  638. Dim oDOMNode As IXMLDOMNode
  639. Dim oDomHhtNode As IXMLDOMNode
  640. Dim oDomHht As DOMDocument
  641. Dim oDomTaxonomyEntries As IXMLDOMNode
  642. Dim strHhtFile As String
  643. Dim dict As Scripting.Dictionary
  644. Set dict = New Scripting.Dictionary
  645. For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  646. ' Let's load the HHT
  647. Set oDomHht = p_GetHht(oDomHhtNode, strCabFolder, strHhtFile)
  648. Set oDomTaxonomyEntries = oDomHht.selectSingleNode("METADATA/TAXONOMY_ENTRIES")
  649. Dim lDuplicates As Long: lDuplicates = 0
  650. prgBar.Max = oDomTaxonomyEntries.childNodes.length + 1
  651. prgBar.Value = 1
  652. Dim oTaxoEntry As IXMLDOMNode
  653. For Each oTaxoEntry In oDomTaxonomyEntries.childNodes
  654. Dim strTitle As String, strCategory As String, strURI As String, strNewURI As String
  655. Dim strKey As String, strEntry As String
  656. Dim oAttrib As IXMLDOMAttribute
  657. Dim vntValue As Variant
  658. strTitle = p_GetAttribute(oTaxoEntry, "TITLE")
  659. strCategory = p_GetAttribute(oTaxoEntry, "CATEGORY")
  660. strURI = p_GetAttribute(oTaxoEntry, "URI")
  661. strEntry = p_GetAttribute(oTaxoEntry, "ENTRY")
  662. If (strEntry = "") Then
  663. ' This is a Topic
  664. strKey = LCase$(strCategory & vbTab & strURI)
  665. Else
  666. ' This is a Node
  667. strKey = LCase$(strCategory & vbTab & strEntry)
  668. End If
  669. If (dict.Exists(strKey)) Then
  670. vntValue = dict(strKey)
  671. If (Not vntValue(0)) Then
  672. vntValue = Array(True, vntValue(1), vntValue(2), vntValue(3), vntValue(4), vntValue(5))
  673. dict.Remove strKey
  674. dict.Add strKey, vntValue
  675. m_fh.WriteLine """" + vntValue(1) + """" + vbTab + _
  676. """" + vntValue(2) + """" + vbTab + _
  677. """" + vntValue(3) + """" + vbTab + _
  678. """" + vntValue(4) + """" + vbTab + _
  679. """" + vntValue(5) + """"
  680. End If
  681. m_fh.WriteLine """" + strTitle + """" + vbTab + _
  682. """" + strCategory + """" + vbTab + _
  683. """" + strURI + """" + vbTab + _
  684. """" + strEntry + """" + vbTab + _
  685. """" + strHhtFile + """"
  686. lDuplicates = lDuplicates + 1
  687. Else
  688. vntValue = Array(False, strTitle, strCategory, strURI, strEntry, strHhtFile)
  689. dict.Add strKey, vntValue
  690. End If
  691. prgBar.Value = prgBar.Value + 1
  692. Next
  693. lTotalDuplicates = lTotalDuplicates + lDuplicates
  694. WriteLog strHhtFile & ": There are " & lDuplicates & " duplicates"
  695. Next
  696. WriteLog "Total : There are " & lTotalDuplicates & " duplicate taxonomy Entries"
  697. RepDuplicates = True
  698. Common_Exit:
  699. If (Not m_fh Is Nothing) Then m_fh.Close: Set m_fh = Nothing
  700. Exit Function
  701. End Function
  702. Function RepTaxoEntriesSameUriDifferentTitle(ByVal strCabFolder As String) As Boolean
  703. RepTaxoEntriesSameUriDifferentTitle = _
  704. RepSamePrimaryDifferentSecondaries(strCabFolder, TAXO_URI, TAXO_TITLE, TextCompare, BinaryCompare)
  705. End Function
  706. Function RepSameUriDifferentContentTypes(ByVal strCabFolder As String) As Boolean
  707. RepSameUriDifferentContentTypes = _
  708. RepSamePrimaryDifferentSecondaries(strCabFolder, TAXO_URI, TAXO_TYPE, TextCompare, BinaryCompare)
  709. End Function
  710. Function RepTaxoEntriesSameTitleDifferentUri(ByVal strCabFolder As String) As Boolean
  711. RepTaxoEntriesSameTitleDifferentUri = _
  712. RepSamePrimaryDifferentSecondaries(strCabFolder, TAXO_TITLE, TAXO_URI)
  713. End Function
  714. Function RepSameTitleDifferentContentTypes(ByVal strCabFolder As String) As Boolean
  715. RepSameTitleDifferentContentTypes = _
  716. RepSamePrimaryDifferentSecondaries(strCabFolder, TAXO_TITLE, TAXO_TYPE, TextCompare, BinaryCompare)
  717. End Function
  718. Function RepSamePrimaryDifferentSecondaries( _
  719. ByVal strCabFolder As String, _
  720. ByVal lxPrimary As TaxoItem, _
  721. ByVal lxSecondary As TaxoItem, _
  722. Optional ByVal PrimaryCompareMethod As CompareMethod = TextCompare, _
  723. Optional ByVal SecondaryCompareMethod As CompareMethod = TextCompare _
  724. ) As Boolean
  725. RepSamePrimaryDifferentSecondaries = False
  726. Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  727. WriteLog "Processing Report for: " + _
  728. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  729. " [ " + _
  730. oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  731. " ]"
  732. Dim lTotalTaxoEntries As Long: lTotalTaxoEntries = 0
  733. ' Now we parse Package_Description.xml to find the HHT Files
  734. Dim oMetadataNode As IXMLDOMNode
  735. Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  736. Dim oDOMNode As IXMLDOMNode
  737. Dim oDomHhtNode As IXMLDOMNode
  738. Dim oDomHht As DOMDocument
  739. Dim strHhtFile As String
  740. ' First we count how many entries we have. We do this, because ther may be
  741. ' more than one HHT in the File.
  742. For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  743. ' Let's load the HHT
  744. Set oDomHht = p_GetHht(oDomHhtNode, strCabFolder, strHhtFile)
  745. Dim oTaxoEntriesList As IXMLDOMNodeList
  746. ' Let's make these queries Super-HHT ready.
  747. oDomHht.setProperty "SelectionLanguage", "XPath"
  748. Set oTaxoEntriesList = oDomHht.selectNodes("/METADATA/TAXONOMY_ENTRIES//TAXONOMY_ENTRY[ string-length( @URI ) > 0 ]")
  749. Dim lTaxoEntries As Long: lTaxoEntries = oTaxoEntriesList.length
  750. WriteLog strHhtFile & ": There are " & lTaxoEntries & " Taxonomy Entries to process"
  751. lTotalTaxoEntries = lTotalTaxoEntries + lTaxoEntries
  752. prgBar.Max = lTaxoEntries + 1
  753. prgBar.Value = 1
  754. Dim oTaxoEntry As IXMLDOMNode
  755. Dim oAssocList As Scripting.Dictionary: Set oAssocList = New Scripting.Dictionary
  756. oAssocList.CompareMode = PrimaryCompareMethod
  757. For Each oTaxoEntry In oTaxoEntriesList
  758. Dim oTaxoRecord As TaxoRecord: Set oTaxoRecord = New TaxoRecord
  759. With oTaxoRecord
  760. .strTitle = p_GetAttribute(oTaxoEntry, "TITLE")
  761. .strCategory = p_GetAttribute(oTaxoEntry, "CATEGORY")
  762. .lContentType = p_GetAttribute(oTaxoEntry, "TYPE")
  763. .strURI = p_GetAttribute(oTaxoEntry, "URI")
  764. .strHhtFile = strHhtFile
  765. p_AddToList oAssocList, _
  766. .Item(lxPrimary), .Item(lxSecondary), oTaxoRecord, SecondaryCompareMethod
  767. End With
  768. prgBar.Value = prgBar.Value + 1
  769. Next
  770. Next
  771. WriteLog "Total : There are " & lTotalTaxoEntries & " taxonomy Entries processed", False
  772. WriteLog "Analyzing " & (oAssocList.Count + 1) & " Unique Entries", False
  773. prgBar.Max = oAssocList.Count + 1
  774. prgBar.Value = 1
  775. ' We create the output report File
  776. Set m_fh = m_fso.CreateTextFile(Me.txtSaveReport, overwrite:=True, Unicode:=True)
  777. m_fh.WriteLine """Title""" + vbTab + _
  778. """Content Type""" + vbTab + _
  779. """Category""" + vbTab + """URI""" + vbTab + """HHT File"""
  780. Dim lPrimaryCount As Long: lPrimaryCount = 0
  781. Dim lSecondaryCount As Long: lSecondaryCount = 0
  782. Dim oSameItemList As Scripting.Dictionary
  783. Dim strKey As Variant
  784. For Each strKey In oAssocList.Keys
  785. Set oSameItemList = oAssocList.Item(strKey)
  786. If (oSameItemList.Count > 1) Then
  787. lPrimaryCount = lPrimaryCount + 1
  788. Dim str2ndKey As Variant
  789. For Each str2ndKey In oSameItemList.Keys
  790. lSecondaryCount = lSecondaryCount + 1
  791. Set oTaxoRecord = oSameItemList.Item(str2ndKey)
  792. With oTaxoRecord
  793. m_fh.WriteLine """" + .strTitle + """" + vbTab + _
  794. """" + CStr(.lContentType) + """" + vbTab + _
  795. """" + .strCategory + """" + vbTab + _
  796. """" + .strURI + """" + vbTab + _
  797. """" + .strHhtFile + """"
  798. End With
  799. Next
  800. End If
  801. prgBar.Value = prgBar.Value + 1
  802. Next
  803. WriteLog "A total of " & lPrimaryCount & " Unique Entries make the report " & _
  804. "creating " & lSecondaryCount & " Excel Rows", False
  805. RepSamePrimaryDifferentSecondaries = True
  806. Common_Exit:
  807. If (Not m_fh Is Nothing) Then m_fh.Close: Set m_fh = Nothing
  808. Exit Function
  809. End Function
  810. Private Sub p_AddToList( _
  811. ByRef oAssocList As Scripting.Dictionary, _
  812. ByRef i_oItemKey As String, _
  813. ByRef i_oItemSecondaryKey As String, _
  814. ByRef i_oItemdata As Variant, _
  815. Optional ByVal SecondaryCompareMethod As CompareMethod = TextCompare _
  816. )
  817. Dim oSameItemList As Scripting.Dictionary
  818. Dim bFoundEqual As Boolean: bFoundEqual = False
  819. ' If this Item does not exist on the main associative array then we first
  820. ' need to create an entry using the primary key
  821. If (Not oAssocList.Exists(i_oItemKey)) Then
  822. Set oSameItemList = New Scripting.Dictionary
  823. oSameItemList.CompareMode = SecondaryCompareMethod
  824. oAssocList.Add i_oItemKey, oSameItemList
  825. End If
  826. ' Now we fetch the Secondary Associative Array pointed by the Key
  827. Set oSameItemList = oAssocList.Item(i_oItemKey)
  828. ' Now we look inside the inner associative array to check whether
  829. ' this Items Secondary Key already exists.
  830. Dim strKey As Variant
  831. For Each strKey In oSameItemList.Keys
  832. ' If (m_ProcessingState = PROC_STOP_PROCESSING) Then
  833. ' GoTo Common_Exit
  834. ' End If
  835. stbProgress.SimpleText = _
  836. "Comparing " & strKey & " to " & i_oItemSecondaryKey
  837. If (StrComp(strKey, i_oItemSecondaryKey, SecondaryCompareMethod) = 0) Then
  838. bFoundEqual = True
  839. Exit For
  840. End If
  841. Next
  842. ' If we did not find the Secondary Key in the Secondary associative array
  843. ' then we need to add it.
  844. If (Not bFoundEqual) Then
  845. oSameItemList.Add i_oItemSecondaryKey, i_oItemdata
  846. End If
  847. Common_Exit:
  848. End Sub
  849. Private Sub p_DisplayParseError( _
  850. ByRef i_ParseError As IXMLDOMParseError _
  851. )
  852. Dim strError As String
  853. strError = "Error: " & i_ParseError.reason & _
  854. "Line: " & i_ParseError.Line & vbCrLf & _
  855. "Linepos: " & i_ParseError.linepos & vbCrLf & _
  856. "srcText: " & i_ParseError.srcText
  857. MsgBox strError, vbOKOnly, "Error while parsing"
  858. End Sub
  859. 'Function RepTaxoEntriesSameUriDifferentTitle(ByVal strCabFolder As String) As Boolean
  860. '
  861. ' RepTaxoEntriesSameUriDifferentTitle = False
  862. '
  863. ' Dim oDomPkg As DOMDocument: Set oDomPkg = GetPackage(strCabFolder)
  864. '
  865. ' WriteLog "Processing Report for: " + _
  866. ' oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("VALUE").Text + _
  867. ' " [ " + _
  868. ' oDomPkg.selectSingleNode("HELPCENTERPACKAGE/SKU").Attributes.getNamedItem("DISPLAYNAME").Text + _
  869. ' " ]"
  870. '
  871. '
  872. ' Dim lTotalTaxoEntries As Long: lTotalTaxoEntries = 0
  873. '
  874. ' ' Now we parse Package_Description.xml to find the HHT Files
  875. ' Dim oMetadataNode As IXMLDOMNode
  876. ' Set oMetadataNode = oDomPkg.selectSingleNode("HELPCENTERPACKAGE/METADATA")
  877. '
  878. '
  879. ' Dim oDOMNode As IXMLDOMNode
  880. ' Dim oDomHhtNode As IXMLDOMNode
  881. ' Dim oDomHht As DOMDocument
  882. ' Dim strHhtFile As String
  883. ' Dim oDictURI As Scripting.Dictionary: Set oDictURI = New Scripting.Dictionary
  884. ' oDictURI.CompareMode = TextCompare
  885. '
  886. '
  887. ' ' First we count how many entries we have. We do this, because ther may be
  888. ' ' more than one HHT in the File.
  889. ' For Each oDomHhtNode In oMetadataNode.selectNodes("HHT")
  890. '
  891. ' ' Let's load the HHT
  892. ' Set oDomHht = p_GetHht(oDomHhtNode, strCabFolder, strHhtFile)
  893. '
  894. ' Dim oTaxoEntriesList As IXMLDOMNodeList
  895. ' ' Let's make these queries Super-HHT ready.
  896. ' oDomHht.setProperty "SelectionLanguage", "XPath"
  897. ' Set oTaxoEntriesList = oDomHht.selectNodes("/METADATA/TAXONOMY_ENTRIES//TAXONOMY_ENTRY[ string-length( @URI ) > 0 ]")
  898. ' Dim lTaxoEntries As Long: lTaxoEntries = oTaxoEntriesList.length
  899. '
  900. ' WriteLog strHhtFile & ": There are " & lTaxoEntries & " Taxonomy Entries to process"
  901. ' lTotalTaxoEntries = lTotalTaxoEntries + lTaxoEntries
  902. '
  903. ' prgBar.Max = lTaxoEntries + 1
  904. ' prgBar.Value = 1
  905. '
  906. ' Dim oTaxoEntry As IXMLDOMNode
  907. ' Dim oAssocList As Scripting.Dictionary: Set oAssocList = New Scripting.Dictionary
  908. ' For Each oTaxoEntry In oTaxoEntriesList
  909. ' Dim oTaxoRecord As TaxoRecord: Set oTaxoRecord = New TaxoRecord
  910. ' With oTaxoRecord
  911. ' .strTitle = p_GetAttribute(oTaxoEntry, "TITLE")
  912. ' .strCategory = p_GetAttribute(oTaxoEntry, "CATEGORY")
  913. ' .lContentType = p_GetAttribute(oTaxoEntry, "TYPE")
  914. ' .strUri = p_GetAttribute(oTaxoEntry, "URI")
  915. ' .strHhtFile = strHhtFile
  916. ' p_AddToList oAssocList, .strUri, .strTitle, oTaxoRecord
  917. ' End With
  918. '
  919. ' prgBar.Value = prgBar.Value + 1
  920. ' Next
  921. '
  922. ' Next
  923. '
  924. '
  925. '
  926. ' WriteLog "Total : There are " & lTotalTaxoEntries & " taxonomy Entries processed", False
  927. '
  928. ' WriteLog "Listing all URIs with Different Titles", False
  929. ' prgBar.Max = oAssocList.Count + 1
  930. ' prgBar.Value = 1
  931. '
  932. ' ' We create the output report File
  933. ' Set m_fh = m_fso.CreateTextFile(Me.txtSaveReport, overwrite:=True, Unicode:=True)
  934. ' m_fh.WriteLine """Title""" + vbTab + _
  935. ' """Content Type""" + vbTab + _
  936. ' """Category""" + vbTab + """URI""" + vbTab + """HHT File"""
  937. '
  938. ' Dim oSameItemList As Scripting.Dictionary
  939. ' Dim strKey As Variant
  940. ' For Each strKey In oAssocList.Keys
  941. ' Set oSameItemList = oAssocList.Item(strKey)
  942. ' If (oSameItemList.Count > 1) Then
  943. ' Dim str2ndKey As Variant
  944. ' For Each str2ndKey In oSameItemList.Keys
  945. ' Set oTaxoRecord = oSameItemList.Item(str2ndKey)
  946. ' With oTaxoRecord
  947. ' m_fh.WriteLine """" + .strTitle + """" + vbTab + _
  948. ' """" + CStr(.lContentType) + """" + vbTab + _
  949. ' """" + .strCategory + """" + vbTab + _
  950. ' """" + .strUri + """" + vbTab + _
  951. ' """" + .strHhtFile + """"
  952. ' End With
  953. ' Next
  954. ' End If
  955. ' prgBar.Value = prgBar.Value + 1
  956. ' Next
  957. '
  958. ' RepTaxoEntriesSameUriDifferentTitle = True
  959. '
  960. 'Common_Exit:
  961. ' If (Not m_fh Is Nothing) Then m_fh.Close: Set m_fh = Nothing
  962. ' Exit Function
  963. '
  964. 'End Function