Hi ,
Please help me to do update in below code so as to create automatically a folder in established location (path D:\MailSave\FirstWordSubject), the folder name is with the first word from the subject mail. If it already exists (path D:\MailSave\) must just to copy in the message.
Sub SaveMsg(MyMail As MailItem)
On Error GoTo err
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim FolderName As String
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
olMail.SaveAs "D:\MailSave\" & olMail.Subject & ".msg", olMSG
Set olMail = Nothing
Set olNS = Nothing
Exit Sub
err:
MsgBox err.Description, vbOKOnly + vbInformation, "Eroare"
End Sub
Please help me to do update in below code so as to create automatically a folder in established location (path D:\MailSave\FirstWordSubject), the folder name is with the first word from the subject mail. If it already exists (path D:\MailSave\) must just to copy in the message.
Sub SaveMsg(MyMail As MailItem)
On Error GoTo err
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim FolderName As String
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
olMail.SaveAs "D:\MailSave\" & olMail.Subject & ".msg", olMSG
Set olMail = Nothing
Set olNS = Nothing
Exit Sub
err:
MsgBox err.Description, vbOKOnly + vbInformation, "Eroare"
End Sub