Sub main() 'https://kinuasa.wordpress.com/2011/04/07/%E3%83%89%E3%83%A9%E3%83%83%E3%82%B0%E3%81%95%E3%82%8C%E3%81%9F%E3%83%9E%E3%83%8D%E3%83%BC%E3%82%B8%E3%83%89dll%E3%82%92regasm%E3%81%A7%E7%99%BB%E9%8C%B2%E3%81%99%E3%82%8B%E3%82%B9%E3%82%AF%E3%83%AA/ Dim FSOM As Object Dim PropKeyFilePath As String Dim myFolder As Folder Dim TFile As String Dim VersionN As String Dim i As Long Const TFolder = "C:\〇×\" Const FN = "Propkey" TFile = TFolder & FN Const SDKFolderPath = "C:\Program Files (x86)\Windows Kits\10\Include\" Const Prop = "\um\propkey.h" Set FSOM = CreateObject("Scripting.FileSystemObject") i = 0 If (FSOM.FolderExists(SDKFolderPath) <> True) Then MsgBox "Win10SDKフォルダが見つかりませんでした。" & vbCrLf & _ "処理を中止します。", 16, MsgTitle Exit Sub Else If (FSOM.FolderExists(TFolder) <> True) Then MsgBox FN & "ファイルを保存するフォルダが見つかりませんでした。" & vbCrLf & _ "処理を中止します。", 16, MsgTitle Exit Sub Else For Each f In FSOM.GetFolder(SDKFolderPath).SubFolders 'https://excelwork.info/excel/fsoparentfolder/ VersionN = "(" & Replace(FSOM.GetFolder(f.Path & "\um").ParentFolder.Name, ".", "_") & ")" PropKeyFilePath = f.Path & Prop Call READWRITE_TextFile4(PropKeyFilePath, TFile & VersionN & ".TXT") i = i + 1 Next End If End If End Sub Sub READWRITE_TextFile4(FILENAME As String, FILENAMEW As String) 'http://www.asahi-net.or.jp/~ef2o-inue/vba_o/sub05_110.html 'http://www.asahi-net.or.jp/~ef2o-inue/vba_o/sub05_110_040.html Dim FSO As New FileSystemObject Dim TS As TextStream Dim strREC As String Dim FSOW As New FileSystemObject Dim TSW As TextStream Set TSW = FSOW.CreateTextFile( _ FILENAME:=FILENAMEW, _ Overwrite:=True) Set TS = FSO.OpenTextFile(FILENAME, ForReading) Do Until TS.AtEndOfStream strREC = TS.ReadLine If Left(strREC, 9) = "// Name:" Then c = c + 1 topCName0 = Mid(strREC, 15, 300) topCName = Left(topCName0, InStr(topCName0, " ") - 1) Else End If If Left(strREC, 13) = "// FormatID:" Then If InStr(strREC, "}") > InStr(strREC, "{") Then ' topFormatID = Mid(strREC, InStr(strREC, "{"), InStr(strREC, "}") - InStr(strREC, "{") + 1) topFormatID = Mid(strREC, InStr(strREC, "{"), 300) Else topFormatID = "error" End If TSW.WriteLine c & "," & topFormatID & "," & topCName Else End If Loop TS.Close Set TS = Nothing Set FSO = Nothing TSW.Close Set TSW = Nothing Set FSOW = Nothing End Sub