Option Explicit 'Change this to the name of the catalog set you wish to export Const ivKeywordSetName = "Places" 'Change this to the path for the file of hierachical keywords you wish to create const filePath = "C:\iViewCategories.txt" Dim ivApp Set ivApp = CreateObject("iView.Application") If (ivApp.Catalogs.Count = 0) Then MsgBox "Please launch Iview MediaPro.", vbCritical, kMsgBoxTitle else Main end if Sub Main() Dim FS, FileStream,ivCat,ivSets,ivKeywords,ivPrevlevel,i,ivLevelNames, ivLevelName, strTabs, cnt,ivSet, iv Set ivCat = ivApp.ActiveCatalog Set ivSets = ivCat.MediaSets Dim ivKeywordLevels(10) ivKeywords = False Set FS = CreateObject("Scripting.FileSystemObject") Set FileStream = FS.OpenTextFile(filePath,2,true) For Each i In ivSets Set ivSet = i If i.Name = ivKeywordSetName And i.Level = 0 Then ivKeywords = True ivPrevlevel = 0 ElseIf i.Level = 0 Then ivKeywords = False End If If ivKeywords = True And i.Name <> ivKeywordSetName Then 'if the current level is less than or equal to the previous level 'purge the previous one's children If i.Level <= ivPrevlevel Then For iv = i.Level To UBound(ivKeywordLevels) ivKeywordLevels(iv) = "" Next End If ivKeywordLevels(i.Level) = i.Name ivPrevlevel = i.Level ivLevelNames = "" For Each ivLevelName In ivKeywordLevels If ivLevelName <> "" Then ivLevelNames = ivLevelNames & chr(9) & ivLevelName End If Next strTabs = "" for cnt = 1 to i.Level -1 strtabs = strtabs & chr(9) next strtabs = strtabs & mid(ivLevelNames,instrrev(ivLevelNames,chr(9))) FileStream.WriteLine strTabs 'msgbox strtabs End If Next Set ivApp = Nothing FileStream.close Set FileStream = Nothing Set FS = Nothing msgbox "done" End sub