ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   outlook express email question (https://www.excelbanter.com/excel-programming/341033-outlook-express-email-question.html)

Gary Keramidas[_4_]

outlook express email question
 
does anyone know if it's possible to pull a line of text out of an outlook
express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary




Gary Keramidas[_4_]

outlook express email question
 
did some investigating, notepad will open the files up, the line i need is
the last line of text and there is 1 blank line after that. i need to loop
through however many files there are, and start pasting that line of text
starting at a1 and continuing down.

any guidance is appreciated.

--


Gary


"Gary Keramidas" wrote in message
...
does anyone know if it's possible to pull a line of text out of an outlook
express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary






Gary Keramidas[_4_]

outlook express email question
 
and the line i need is always line number 25

--


Gary


"Gary Keramidas" wrote in message
...
does anyone know if it's possible to pull a line of text out of an outlook
express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary






Gary Keramidas[_4_]

outlook express email question
 
here's what i have so far, it works as i need it for the explicit filename.
now i need to figure out how to get it to read every file in the folder.
anyone able to help?


Option Explicit
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As Variant
Dim sRow As Integer
Dim lRow As Range
Dim fil As Variant
Dim fdir As Variant

Sub ImportTextLines()
Application.ScreenUpdating = False
fdir = "C:\Cats\"
fil = "catalog Request.eml"
ColNdx = ActiveCell.Column
RowNdx = ActiveCell.Row
sRow = RowNdx
FName = fdir & fil
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
Range(Rows(sRow), Rows(sRow + 23)).Delete
RowNdx = RowNdx + 1
Wend

Range("A" & sRow).Offset(1, 0).Select

Close #1
Application.ScreenUpdating = True
End Sub

--


Gary


"Gary Keramidas" wrote in message
...
does anyone know if it's possible to pull a line of text out of an outlook
express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary






Norman Jones

outlook express email question
 
Hi Gary,

now i need to figure out how to get it to read every file in the folder.
anyone able to help?


See techniques adopted by Ron de Bruin in sample code at:

http://www.rondebruin.nl/copy3.htm


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
here's what i have so far, it works as i need it for the explicit
filename. now i need to figure out how to get it to read every file in the
folder.
anyone able to help?


Option Explicit
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As Variant
Dim sRow As Integer
Dim lRow As Range
Dim fil As Variant
Dim fdir As Variant

Sub ImportTextLines()
Application.ScreenUpdating = False
fdir = "C:\Cats\"
fil = "catalog Request.eml"
ColNdx = ActiveCell.Column
RowNdx = ActiveCell.Row
sRow = RowNdx
FName = fdir & fil
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
Range(Rows(sRow), Rows(sRow + 23)).Delete
RowNdx = RowNdx + 1
Wend

Range("A" & sRow).Offset(1, 0).Select

Close #1
Application.ScreenUpdating = True
End Sub

--


Gary


"Gary Keramidas" wrote in message
...
does anyone know if it's possible to pull a line of text out of an
outlook express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary








Gary Keramidas[_4_]

outlook express email question
 
got it working, thanks. don't know how well it's coded, but it works.

--


Gary


"Norman Jones" wrote in message
...
Hi Gary,

now i need to figure out how to get it to read every file in the folder.
anyone able to help?


See techniques adopted by Ron de Bruin in sample code at:

http://www.rondebruin.nl/copy3.htm


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
here's what i have so far, it works as i need it for the explicit
filename. now i need to figure out how to get it to read every file in
the folder.
anyone able to help?


Option Explicit
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim WholeLine As String
Dim FName As Variant
Dim sRow As Integer
Dim lRow As Range
Dim fil As Variant
Dim fdir As Variant

Sub ImportTextLines()
Application.ScreenUpdating = False
fdir = "C:\Cats\"
fil = "catalog Request.eml"
ColNdx = ActiveCell.Column
RowNdx = ActiveCell.Row
sRow = RowNdx
FName = fdir & fil
Open FName For Input Access Read As #1

While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
Range(Rows(sRow), Rows(sRow + 23)).Delete
RowNdx = RowNdx + 1
Wend

Range("A" & sRow).Offset(1, 0).Select

Close #1
Application.ScreenUpdating = True
End Sub

--


Gary


"Gary Keramidas" wrote in message
...
does anyone know if it's possible to pull a line of text out of an
outlook express .eml file? there is only 1 line of text in the body.
there could be any number of .eml files in a folder that i would like to
pull the tab delimited line of text and paste it into a sheet.

--


Gary











All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com