Excelmacros不同的邮件提取后的文件名

这是我的代码:

Sub TestRun() ' Define variables Dim file As String, folder As String ' Define working directory folder = "E:\MainFolder\Appointments\" ' Define type of file to search for file = Dir(folder & "*.zip") ZipPath = "E:\MainFolder\Appointments\" & file Call UnZip(folder, ZipPath) End Sub 

我想提取后有不同的文件名。 我希望它是约会而不是文件

解压缩后,您可以使用Name函数简单地重命名文件

 Name folder & oldFilename As folder & newFilename