|
|
|
date: Tue, 1 Jul 2008 04:33:50 -0700 (PDT),
group: microsoft.public.platformsdk.mapi
back
How can I create a VISIBLE Search folder (Delphi)
Dear All,
My goal is to create a search folder, under the "finder" folder (the
one you get using the PR_FINDER_ENTRYID property)
I actually have no problem creating the folder and using it, but it
doesn't appears in Outlook UI, which is what I want.
The only differences between my newly created folder and the existing
ones are the PR_CONTAINER_CLASS property, which I set to 'IPF.Note',
and the 0x36DA (PT_BINARY).
I'm unable to figure out what is the latest and what is its use.
Just to make sure, I've confirmed that I'm able to create a new search
folder through the Outlook UI with no pb.
Can anyone tell me how to create a Search Folder through Ext Mapi that
shows in Outlook?
This is the piece of the code to create the Folder:
function FinderFolder:IMAPIFolder;
var
.....
begin
if HrGetOneProp(FMsgstr,PR_FINDER_ENTRYID,lppPropArray)=S_OK then
try
if FMsgstr.OpenEntry(lppPropArray^.Value.bin.cb,
PENTRYID(lppPropArray^.Value.bin.lpb), IMapiFolder,
MAPI_BEST_ACCESS or MAPI_MODIFY, lpulObjectType,
IInterface(FFinderFolder)) <> S_OK then
FFinderFolder := nil
else
begin
Result := FFinderFolder;
end;
finally
MapiFreeBuffer(lppPropArray);
end;
end;
Procedure CreateSearchFolder;
var
....
begin
...
res:=FinderFolder.CreateFolder(FOLDER_SEARCH,name,comment,TGUID(nil^),
MAPI_DEFERRED_ERRORS
+OPEN_IF_EXISTS,FSearchFldr);
if res= S_OK then
if HrGetOneProp(FSearchFldr, PR_ENTRYID,prop)=S_OK then
begin
Result:=FSearchFldr;
FSearchFldrID:=prop.Value.bin;
prop2.ulPropTag:=PR_CONTAINER_CLASS;
Prop2.Value.lpszA:='IPF.Note';
res:=HrSetOneProp(FSearchFldr,@prop2);
if res<>S_Ok then ..
date: Tue, 1 Jul 2008 04:33:50 -0700 (PDT)
author: patochem
Re: How can I create a VISIBLE Search folder (Delphi)
See my reply in the messaging newsgroup.
Please do not multipost.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"patochem" wrote in message
news:23ae00f5-c58c-4918-a2bb-7b6a514cc673@59g2000hsb.googlegroups.com...
> Dear All,
>
> My goal is to create a search folder, under the "finder" folder (the
> one you get using the PR_FINDER_ENTRYID property)
>
> I actually have no problem creating the folder and using it, but it
> doesn't appears in Outlook UI, which is what I want.
>
> The only differences between my newly created folder and the existing
> ones are the PR_CONTAINER_CLASS property, which I set to 'IPF.Note',
> and the 0x36DA (PT_BINARY).
>
> I'm unable to figure out what is the latest and what is its use.
> Just to make sure, I've confirmed that I'm able to create a new search
> folder through the Outlook UI with no pb.
>
> Can anyone tell me how to create a Search Folder through Ext Mapi that
> shows in Outlook?
>
> This is the piece of the code to create the Folder:
>
> function FinderFolder:IMAPIFolder;
> var
> .....
> begin
> if HrGetOneProp(FMsgstr,PR_FINDER_ENTRYID,lppPropArray)=S_OK then
> try
> if FMsgstr.OpenEntry(lppPropArray^.Value.bin.cb,
> PENTRYID(lppPropArray^.Value.bin.lpb), IMapiFolder,
> MAPI_BEST_ACCESS or MAPI_MODIFY, lpulObjectType,
> IInterface(FFinderFolder)) <> S_OK then
> FFinderFolder := nil
> else
> begin
> Result := FFinderFolder;
> end;
> finally
> MapiFreeBuffer(lppPropArray);
> end;
> end;
>
> Procedure CreateSearchFolder;
> var
> ....
> begin
> ...
>
> res:=FinderFolder.CreateFolder(FOLDER_SEARCH,name,comment,TGUID(nil^),
> MAPI_DEFERRED_ERRORS
> +OPEN_IF_EXISTS,FSearchFldr);
>
> if res= S_OK then
> if HrGetOneProp(FSearchFldr, PR_ENTRYID,prop)=S_OK then
> begin
> Result:=FSearchFldr;
> FSearchFldrID:=prop.Value.bin;
>
> prop2.ulPropTag:=PR_CONTAINER_CLASS;
> Prop2.Value.lpszA:='IPF.Note';
> res:=HrSetOneProp(FSearchFldr,@prop2);
> if res<>S_Ok then ..
date: Tue, 1 Jul 2008 09:01:06 -0700
author: Dmitry Streblechenko
|
|