Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code works for me in that it will fetch the body of all the
messages selected in my outlook inbox. So, if you're not getting any data the problem must be in your parsing code. Hard to tell without a sample message to look at. Comment on this: Tabl = Split(mybody, Chr(10)) For Each Item In Tabl Item = Replace(Item, Chr(10), "") '**** not required Item = Application.Clean(Item) Next Item If you've split the text into lines on Chr(10), there should be no Chr (10) in any of the lines, so you can omit that line. You might also consider splitting out the "search" part into a separate function Function GetValue(arrLines, LookFor As String) As String Dim x As Integer Dim rv As String, line As String rv = "" For x = LBound(arrLines) To UBound(arrLines) line = arrLines(x) If LCase(line) Like LookFor & "*" Then rv = Mid(line, Len(LookFor) + 4, 999) Exit For End If Next x GetValue = rv End Function Call using something like: tmp = GetValue(Tabl,"first name") .Cells(2).value = Application.Proper(tmp) If you could post an example (altered if required) of a typical message body that would help. Tim On Dec 15, 2:53*pm, Monomeeth wrote: Hi Tim Thanks for the suggestion. I removed it and there was no noticeable difference - exactly the same result. I don't suppose you'd have any other ideas? Joe. -- If you can measure it, you can improve it! "Tim Williams" wrote: What happens if you remove the "On Error Resume Next" ? Tim "Monomeeth" wrote in message ... Oops, forgot to mention that I have tried selecting messages in Outlook before running the Macro in Excel, but this seems to have no effect. Not selecting any messages beforehand also has no effect. .- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy and paste values (columns)I have a macro file built | Excel Programming | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |