掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ワードファイル(多数)に対するあいまい検索を実現するには (ID:117966)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ワードファイルをテキストファイル形式に変換してその後にテキストファイルに対して検索をかけるプログラムを作っています。 しかしワードファイル(約100回)のOPENとCLOSEに時間がかかりすぎる状況です。何かいい手はないのでしょうか? 一括変換など・・・。すいません。 以下現時点のコードです Private Sub Command1_Click() Dim wdApp As New Word.Application Dim wdDoc As Word.Document Dim strTemplate As String Dim i strBMPFile = Dir$("SIYOUSYO\*.*") 'ファイルだけならこちらでも 'strBMPFile が空になるまで繰り返し Do While strBMPFile <> "" intKen = intKen + 1 ReDim Preserve strMyFile(intKen) 'ファイル名を配列に格納 strMyFile(intKen) = strBMPFile strBMPFile = Dir$ '次のファイル名を読込 Loop For i = 1 To intKen List1.AddItem (strMyFile(i)) Next i MsgBox strMyFile(1) MsgBox strMyFile(2) Dim count count = 1 Do Set wdDoc = wdApp.Documents.Open("SIYOUSYO\" & strMyFile(count)) wdDoc.SaveAs "SIYOUSYO\" & "Sample" & count & ".txt", wdFormatText wdDoc.Close Set wdDoc = Nothing count = count + 1 Loop While intKen >= count wdApp.Quit Set wdApp = Nothing MsgBox "作業終了" End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.