當前位置:編程學習大全網 - 編程軟體 - 用VB2005編壹個批量doc轉txt的程序

用VB2005編壹個批量doc轉txt的程序

我試了下成功了,就是word壹開始提示要安裝下轉換器,我把安裝關盤放進去了以後,Word自動安裝好了以後就沒有問題了··呵呵··

Option?Explicit

Private?Sub?Command1_Click()

Dim?i?As?Integer

CommonDialog1.DialogTitle?=?"選擇要轉換的.doc文件"

CommonDialog1.Filter?=?"*.doc|*.doc"

CommonDialog1.ShowOpen

For?i?=?0?To?List1.ListCount?-?1

If?CommonDialog1.FileName?=?List1.List(i)?Then

MsgBox?"此文件已經添加"

Exit?Sub

End?If

Next?i

List1.AddItem?CommonDialog1.FileName

End?Sub

Private?Sub?Command2_Click()

If?List1.ListCount?=?0?Then?MsgBox?"請至少選擇壹個要轉換的文件":?Exit?Sub

Dim?i?As?Integer,?s?As?String

For?i?=?0?To?List1.ListCount?-?1

Name?List1.List(i)?As?Left(List1.List(i),?Len(List1.List(i))?-?4)?&?".txt"

Next?i

i?=?MsgBox("總***?"?&?List1.ListCount?&?"?個文件轉化成功,是否繼續?",?vbYesNo?+?vbQuestion,?"轉換成功!")

If?i?=?6?Then?List1.Clear?Else?End

End?Sub

  • 上一篇:如何形象地描寫恐龍?
  • 下一篇:學習JAVA編程 都需要下載那些東西呢 比如eclipse,myeclipse,jdk
  • copyright 2024編程學習大全網