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

AdvancedSearch on a substring of a mail subject field



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 8th 08, 10:49 AM posted to microsoft.public.outlook.program_vba
Andrew Lockwood
external usenet poster
 
Posts: 10
Default AdvancedSearch on a substring of a mail subject field

I am trying to create a COM AddIn in Delphi, and I want to use the
AdvancedSearch functionality of Outlook.

If I am searching on the whole field, the following code works correctly

'urn:schemas:httpmail:subject = ' + QuotedStr(MyString)

From Outlook, I have determined that to search on a substring, the code in
VBA would be

"urn:schemas:httpmail:subject" LIKE '%MySubString%'

However, I have been unable to translate this successfully into Delphi. Can
anyone help?


Andrew Lockwood


Ads
  #2  
Old October 9th 08, 10:11 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default AdvancedSearch on a substring of a mail subject field

' "urn:schemas:httpmail:subject" LIKE ''%MySubString%'' '

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
I am trying to create a COM AddIn in Delphi, and I want to use the
AdvancedSearch functionality of Outlook.

If I am searching on the whole field, the following code works correctly

'urn:schemas:httpmail:subject = ' + QuotedStr(MyString)

From Outlook, I have determined that to search on a substring, the code in
VBA would be

"urn:schemas:httpmail:subject" LIKE '%MySubString%'

However, I have been unable to translate this successfully into Delphi.
Can anyone help?


Andrew Lockwood



  #3  
Old October 10th 08, 02:14 AM posted to microsoft.public.outlook.program_vba
Andrew Lockwood
external usenet poster
 
Posts: 10
Default AdvancedSearch on a substring of a mail subject field

Thanks - but it doesn't work!

It doesn't cause a crash like some of the options I have tried, so
presumably this means that the filter is formatted in an acceptable way, but
the search takes quite a long time and returns nothing! Whereas if I create
a SearchFolder within Outlook using the same substring, it works perfectly
and takes about 1 second!


Andrew Lockwood

"Dmitry Streblechenko" wrote in message
...
' "urn:schemas:httpmail:subject" LIKE ''%MySubString%'' '

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
I am trying to create a COM AddIn in Delphi, and I want to use the
AdvancedSearch functionality of Outlook.

If I am searching on the whole field, the following code works correctly

'urn:schemas:httpmail:subject = ' + QuotedStr(MyString)

From Outlook, I have determined that to search on a substring, the code
in VBA would be

"urn:schemas:httpmail:subject" LIKE '%MySubString%'

However, I have been unable to translate this successfully into Delphi.
Can anyone help?


Andrew Lockwood





  #4  
Old October 11th 08, 01:05 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default AdvancedSearch on a substring of a mail subject field

Are you sure you are searching in the right place?
Save the search (AdvancedSearch.Save - that will create a search folder) and
look at it with OutlookSpy (click IMsgStore button, select
PR_FINDER_ENTRYID, right click, select IMAPISession::OpenEntry, in the
IMAPIFolder window go to the GetHierarchyTable tab, open the new search
folder, in the new IMAPIFolder window go to the GetSearchCriteriaTab. What
do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
Thanks - but it doesn't work!

It doesn't cause a crash like some of the options I have tried, so
presumably this means that the filter is formatted in an acceptable way,
but the search takes quite a long time and returns nothing! Whereas if I
create a SearchFolder within Outlook using the same substring, it works
perfectly and takes about 1 second!


Andrew Lockwood

"Dmitry Streblechenko" wrote in message
...
' "urn:schemas:httpmail:subject" LIKE ''%MySubString%'' '

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
I am trying to create a COM AddIn in Delphi, and I want to use the
AdvancedSearch functionality of Outlook.

If I am searching on the whole field, the following code works correctly

'urn:schemas:httpmail:subject = ' + QuotedStr(MyString)

From Outlook, I have determined that to search on a substring, the code
in VBA would be

"urn:schemas:httpmail:subject" LIKE '%MySubString%'

However, I have been unable to translate this successfully into Delphi.
Can anyone help?


Andrew Lockwood







  #5  
Old October 26th 08, 08:15 AM posted to microsoft.public.outlook.program_vba
Andrew Lockwood
external usenet poster
 
Posts: 10
Default AdvancedSearch on a substring of a mail subject field

Thanks - I got it working in the end. However, I changed so many things in
the attempt, that I do not actually know where the problem was.

Andrew Lockwood

"Dmitry Streblechenko" wrote in message
...
Are you sure you are searching in the right place?
Save the search (AdvancedSearch.Save - that will create a search folder)
and look at it with OutlookSpy (click IMsgStore button, select
PR_FINDER_ENTRYID, right click, select IMAPISession::OpenEntry, in the
IMAPIFolder window go to the GetHierarchyTable tab, open the new search
folder, in the new IMAPIFolder window go to the GetSearchCriteriaTab. What
do you see?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
Thanks - but it doesn't work!

It doesn't cause a crash like some of the options I have tried, so
presumably this means that the filter is formatted in an acceptable way,
but the search takes quite a long time and returns nothing! Whereas if I
create a SearchFolder within Outlook using the same substring, it works
perfectly and takes about 1 second!


Andrew Lockwood

"Dmitry Streblechenko" wrote in message
...
' "urn:schemas:httpmail:subject" LIKE ''%MySubString%'' '

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Andrew Lockwood" wrote in message
...
I am trying to create a COM AddIn in Delphi, and I want to use the
AdvancedSearch functionality of Outlook.

If I am searching on the whole field, the following code works
correctly

'urn:schemas:httpmail:subject = ' + QuotedStr(MyString)

From Outlook, I have determined that to search on a substring, the code
in VBA would be

"urn:schemas:httpmail:subject" LIKE '%MySubString%'

However, I have been unable to translate this successfully into Delphi.
Can anyone help?


Andrew Lockwood









 




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
how can I search a substring in Outlook emails? David Outlook Newbie Outlook - General Queries 4 September 17th 08 05:50 PM
Subject field type change? MHull69 Outlook - Using Forms 5 January 19th 07 10:14 PM
Outlook Form and the Subject Field roblowein Outlook - General Queries 1 January 4th 07 05:30 PM
Automatic Text in Subject Field Dries Goossens Outlook and VBA 1 October 10th 06 07:58 AM
Edit Subject Field Meeme Outlook - Calandaring 2 April 18th 06 02:59 PM


All times are GMT +1. The time now is 09:02 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.