ThrottleWorks
Excel Ninja
Hi,
I have an e-mail. This e-mail has few text lines and one InfoPath form in between.
This form has few text boxes and few questions with multiple options.
Users has filled text box with text value and selected one radio button for each question.
How do I export this e-mail to excel with original format.
The code I am using is exporting e-mail without text box and radio buttons.
How to I export e-mail with all the text boxes and radio buttons.
Can anyone please help me in this.
I have an e-mail. This e-mail has few text lines and one InfoPath form in between.
This form has few text boxes and few questions with multiple options.
Users has filled text box with text value and selected one radio button for each question.
How do I export this e-mail to excel with original format.
The code I am using is exporting e-mail without text box and radio buttons.
How to I export e-mail with all the text boxes and radio buttons.
Can anyone please help me in this.
Code:
Public Sub PickOutlookFolder()
Dim ObjOutlook As Object
Dim MyNamespace As Object
Dim i As Integer
Dim j As Long
Dim abody() As String
Set ObjOutlook = GetObject(, "Outlook.Application")
Set MyNamespace = ObjOutlook.GetNamespace("MAPI")
Dim MacroBook As Workbook
Dim MapSht As Worksheet
Dim DataSht As Worksheet
Set MacroBook = ThisWorkbook
Set DataSht = MacroBook.Worksheets("Data")
Dim objNS As Namespace
Dim objFolder As Folder
Dim strFolderPath As String
Dim strEntryID As String
Set objNS = Outlook.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
Dim olMail As Variant
If TypeName(objFolder) <> "Nothing" Then
For Each olMail In objFolder.Items
abody = Split(olMail.Body, Chr(13) & Chr(10))
For j = 0 To UBound(abody)
DataSht.Cells(65000, 1).End(xlUp).Offset(1, 0).Value = abody(j)
Next
Next olMail
End If
strFolderPath = objFolder.FolderPath
strEntryID = objFolder.EntryID
MapSht.Range("E1").Value = strFolderPath
Set objFolder = Nothing
Set objNS = Nothing
End Sub