I need to extract all outlook mails to single text file. I have a code for it ,but it extracts each mail to separate text file. But i need all in single text file. Please its very urgent
The present code is given below.
Sub saveEmailTxt()
Dim objItem As Object
Dim iCount As Integer
'iterate over all Items in the current folder and save the body as textfile in c:\ '
For Each objItem In ActiveExplorer.CurrentFolder.Items
objItem.SaveAs "C:\Mail" & CStr(iCount) & ".txt", olSaveAsText
iCount = iCount + 1
Next
End Sub
The present code is given below.
Sub saveEmailTxt()
Dim objItem As Object
Dim iCount As Integer
'iterate over all Items in the current folder and save the body as textfile in c:\ '
For Each objItem In ActiveExplorer.CurrentFolder.Items
objItem.SaveAs "C:\Mail" & CStr(iCount) & ".txt", olSaveAsText
iCount = iCount + 1
Next
End Sub