所以就像主题标题说的那样,我正在寻找一些关于宏的帮助。我的工作需要它,所以每次执行客户端备份时,他都会向邮箱发送邮件,这些邮件会导出到文件夹中。这是邮件格式:
Backup Rapport Success 客户名称 File Backup Set Taak 2012-10-23 (20 30)
宏需要做一些事情:
- 提取客户端名称
- 提取或备份成功或失败或错过
- 并在正确的单元格中写入成功或失败消息
这甚至可能吗?
Public Function FileFolderExists(strFullPath As String) As Boolean
'Author : Ken Puls (www.excelguru.ca)
'Macro Purpose: Check if a file or folder exists
On Error GoTo EarlyExit
If Not Dir(strFullPath, vbDirectory) = vbNullString Then FileFolderExists = True
EarlyExit:
On Error GoTo 0
End Function
Public Sub TestFolderExistence()
'Author : Ken Puls (www.excelguru.ca)
'Macro Purpose: Test if directory exists
If FileFolderExists("c:\test") Then
MsgBox "Folder exists!"
Else
MsgBox "Folder does not exist!"
End If
End Sub