Private TxtName() As String' defines an array to load txt names.
Fuzzy sPath in string form
Subget txt name (byval spath as string, byval filter as string)' This is the process of getting the file name with the specified suffix in the specified folder and loading it into the array txtname (), where spath is the folder path where txt is written.
Dim sDir as a string
Dim sFilter () as a string.
Dim lngFilterIndex is the same length
Dim lngIndex As Long
SFilter = Split (filter, ",")
If Right(sPath, 1)& lt; & gt "So Spas = Spas &" \ "
Forlngfilterindex = lbound (sfilter) to UBound(sFilter)
sDir = Dir(sPath & amp; sFilter(lngFilterIndex))
Do While Len(sDir)>0
lngfiles = lngfiles + 1
ReDim Preserve TxtName( 1 to lngfiles)
TxtName(lngfiles) = sDir
sDir = Dir
ring
then
End joint
Private subcommand 1_Click ()
Dimension i%
sPath = App。 Path and path. "\"
Call gettext name(sPath, "*. html”)
For i = 1 to UBound(TxtName)
Name Spath & txtname (i) as Spath &; Left(TxtName(i),InStr(TxtName(i)," ")- 1)& amp; ".pdf "
then
MsgBox "done!"
End joint