Extracting Data from folder of EML files when data is UNDER the string signifying it

Mgutarova

New Member
Joined
May 29, 2019
Messages
2
I've been mainly working off this code: https://www.mrexcel.com/forum/gener...6-extract-specific-data-folder-eml-files.html

as both the folder of eml files and the output are what I want (except I will have more columns). The problem is my EML data looks like this:

Name:
Eric Wilby
Title:
Owner
Company Name:
PreContracting
Email:
Pa9999@gmx.com
Phone No.:
8172999070
How do you intend to use the product?
Final step for exterior electrical equipment in/on coastal installations
What problem are you trying to solve?
Longevity of electrical equipment in a corrosive salt water area
How did you hear about us?
Hunting show
Mailing Address:
82 Mansfield Dr
Unit 68
Mansfield ma 79598

I'm having trouble altering this part of the VBA code:

[FONT=&quot]Open MyPath & MyFile For Input As #1 [/FONT]
[FONT=&quot] CountOfFields = 0[/FONT]
[FONT=&quot] Do Until EOF(1)[/FONT]
[FONT=&quot] Line Input #1 , strData[/FONT]
[FONT=&quot] If UCase(Left(strData, 5)) = "DATE:" Then[/FONT]
[FONT=&quot] CountOfFields = CountOfFields + 1[/FONT]
[FONT=&quot] strDate = Trim(Mid(strData, 6))[/FONT]
[FONT=&quot] ElseIf UCase(Left(strData, 17)) = "MEMBER LOGGED IN:" Then[/FONT]
[FONT=&quot] CountOfFields = CountOfFields + 1[/FONT]
[FONT=&quot] strMember = Trim(Mid(strData, 18))[/FONT]
[FONT=&quot] ElseIf UCase(Left(strData, 6)) = "EMAIL:" Then[/FONT]
[FONT=&quot] CountOfFields = CountOfFields + 1[/FONT]
[FONT=&quot] strEmail = Trim(Mid(strData, 7))[/FONT]
Thank you so much for any help you can give me
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,216,085
Messages
6,128,733
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top