A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2003... search for line break char



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old October 4th 07, 03:45 PM posted to microsoft.public.outlook.program_vba
Ben Bradley
external usenet poster
 
Posts: 9
Default Outlook 2003... search for line break char

Hi Sue

This is what I've changed the code to, but it doesn't seem to work.

I was hoping it would flag each email with a yellow flag, but when I
click 'Run' it just disappears and no mails are flagged.


Sub DoSearch()
Dim fld As Outlook.MAPIFolder
Dim itm As Object
Dim strFind As String
On Error Resume Next
Set fld = Application.Session.Folders("BB WEBSITE FORMS")
strFind = "double-sized listing?" & vbCrLf & "Yes"
' or vbLf it's line feed not a complete CRLF
For Each itm In fld.Items
If InStr(1, Item.Body, strFind, vbTextCompare) 0 Then
itm.FlagIcon = olYellowFlagIcon
itm.Save
End If
Next
Set itm = Nothing
Set fld = Nothing
End Sub



Do I need to specify that it's actually a sub-folder within my Inbox?
Or does the macro just look at the folder name and know where in the
Mailbox it's located?
What happens if you have many folders with the same name but in
different locations within your mailbox?


Thanks
Ben


Sue Mosher [MVP-Outlook] wrote:
Every folder has a Folders collection that represents its subfolders. Each subfolder in a Folders collection must have a unique name. Hence, you can use fld.Folders("BB Website Forms").

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007: How to break vertical line in reply to message? [email protected] Outlook - General Queries 1 October 5th 07 09:15 PM
Outlook 2003... search for line break char Ben Bradley Outlook - General Queries 0 September 24th 07 04:29 PM
Outlook 2003 - Search folders - adding criteria to an old mail search? Dustin Emhart Outlook - General Queries 0 December 20th 06 02:39 PM
how do I break up a large attachment that I am sending in Outlook roger Outlook - Installation 1 April 19th 06 08:11 PM
How to input line break in the body of an email defined in vb. Xluser@work Outlook and VBA 1 February 22nd 06 02:20 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.