Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Help with Macro please...

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy and paste values (columns)I have a macro file built C02C04 Excel Programming 2 May 2nd 08 01:51 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"