View Single Post
  #4  
Old June 12th 06, 08:38 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default verify and delete mailitem

Am Sun, 11 Jun 2006 12:12:24 GMT schrieb Joanne:

Thanks, Joanne. But itīs no magic, for most of us developing software is the
job for many years.

"Parsing text" gives a lot of results. If you do have a link maybe I can
tell more about that function.

But why donīt you like the InStr function?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Michael
I was cracking my brain on this all day yesterday and here you make it
just a short and sweet few lines. Excellent!! I thank you for your
time.
I spent considerable time at outlookcode.com yesterday and found
something called parsing text that looks at these kind of emails where
there is a label: data format and tried writing it up for my own use
but failed at it.
I am gratefully going to use your loop to do this particular job, but
I would like to know if it would be feasible to use the parsing text
in a case like this - I know there are many ways to skin the cat in
programming, I simply am woefully short on the knowledge to accomplish
it.
But I do love the hunt - especially when you mvps give us the help we
need when we get bottled up. Just reading your groups I pickup so many
hints and points in the right direction. Better than a classroom any
day!
Thanks again
Joanne
Michael Bauer wrote:

Am Sat, 10 Jun 2006 18:17:30 GMT schrieb Joanne:

Joanne, ThisOutlookSession is a good place for the code. For being able to
delete items you need a backward loop. Outlookīs Selection object doesnīt
know a Find method, instead you can use the Instr function:

Dim i as Long
....
For i=Items.Count To 1 Step-1
Set obj=Items(i)
If InStr(1, obj.Body, "Description: Successful", vbTextCompare)

Then
obj.Delete
Endif
Next

Your loop handles all the items in the folder - again and again. If you

have
another mechanism to clean up that folder then thatīs ok. If instead the
folderīs content grows more and more then youīll probably wish a faster

way
to loop through the unhandled items only.

Ads