Read email content and save the data down in database (1 Viewer)

Derek

Registered User.
Local time
Yesterday, 17:53
Joined
May 4, 2010
Messages
234
Guys, one more question . At the moment the macro extracts data from email to .txt file and there is separate .txt file for each email.

How can I change the code so that data is extracted into excel file instead and there is just one excel file stored in a location where all the data gets copied across so instead of separate file for each email , there is just one excel spreadsheet .

Any help will be much appreciated . Thanks.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:53
Joined
Sep 21, 2011
Messages
14,048
I not sure why you want to hold it all in an Excel workbook?

I'd probably save the files as you are doing, then if you needed someway to reference them, then use hyperlinks in a Excel workbook to the files.

https://analysistabs.com/excel-vba/hyperlinks-examples/

Google using Excel from Access to get an idea of what you would need to do, basically

Open the file
Find last row
On next row insert hyperlink, plus any other data
Increment row
Repeat until all the data is entered
Close file.
 

Derek

Registered User.
Local time
Yesterday, 17:53
Joined
May 4, 2010
Messages
234
Thanks gasman . What changes do
I need to make in my macro so that we can extract data to excel file ? Suppose in one extract there are 100 emails so when the macro is run then it will extract data from those 100 emails to one excel workbook and save it down with unique name. Now when we do extract again with new set of emails then it should create another excel workbook with data from those emails and so on .
Any help will be much appreciated .
Thanks
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:53
Joined
Sep 21, 2011
Messages
14,048
Well it is not a task to be taken lightly. Well not for me.
Start googling for something like transfer data from access to excel
If it was a table or query you could use CopyFromRecordSet, but as yours is piecemeal, I'd probably set each cell from your data variables.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:53
Joined
Sep 21, 2011
Messages
14,048
I thought more about this when I woke up this morning.?

I'd probably write the data to a table with some identifier, then have a routine that asks for that identifier and sends all that data to Excel as a recordset.?

That way you can regenerate the workbooks any time you are asked.?

HTH
 

Users who are viewing this thread

Top Bottom