Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C# and Extended MAPI Sub Restriction

66 views
Skip to first unread message

DaveSam

unread,
Aug 15, 2005, 8:01:53 AM8/15/05
to
Good morning,

I am trying to use C# to call Extended Mapi and restrict the results of
a search by the recipients email address. I understand that I have to
use the restriction method, but I can't find any samples of using the
subrestriction in C#.

Can anyone point me in the right direction?

Thanks,

Dave

Stephen Griffin

unread,
Aug 15, 2005, 10:35:21 AM8/15/05
to
We don't support the use of MAPI from C#:
http://support.microsoft.com/kb/813349
http://support.microsoft.com/kb/872895

"DaveSam" <daves...@comcast.net> wrote in message
news:1124107313.0...@f14g2000cwb.googlegroups.com...

Dan Mitchell

unread,
Aug 15, 2005, 11:36:44 AM8/15/05
to
"DaveSam" <daves...@comcast.net> wrote in news:1124107313.006531.150690
@f14g2000cwb.googlegroups.com:

> I am trying to use C# to call Extended Mapi and restrict the results of
> a search by the recipients email address. I understand that I have to
> use the restriction method, but I can't find any samples of using the
> subrestriction in C#.

As Stephen said, it's not meant to work -- however, some people have
posted here in the past who seem to be using something called mapi33.net.
I've never tried it, but it might be worth a look if you're absolutely
stuck using C#. A better would be to switch to C++, where it's got native
support and you won't hit mysterious .net interop problems.

-- dan

DaveSam

unread,
Aug 15, 2005, 12:43:27 PM8/15/05
to
Dan,

Thanks for the response.

However, not sure how you can say that when there are several "How To"
articles that also appear on the Microsoft site with information on
using MAP with c#.


Maybe all those articles should be pulled if you don't "Support" it???

DaveSam

unread,
Aug 15, 2005, 12:52:12 PM8/15/05
to
Sorry, Dan, mixed up the names.

I have been working with MAPI33, but ran into one problem...just
thought I would give this a try.

Thanks again,

Dave

Dan Mitchell

unread,
Aug 15, 2005, 2:35:12 PM8/15/05
to
"DaveSam" <daves...@comcast.net> wrote in news:1124124207.037988.97930
@g43g2000cwa.googlegroups.com:

> However, not sure how you can say that when there are several "How To"
> articles that also appear on the Microsoft site with information on
> using MAP with c#.

Not any more there aren't. There used to be a couple, (Q315653 and
Q315367), but as far as I know they got taken away -- if you can still
find any, I guess you should keep them quiet so that MS don't remove those
ones as well.

-- dan

Stephen Griffin

unread,
Aug 15, 2005, 6:04:12 PM8/15/05
to
Too late. I just found one this morning that I'm in the process of getting
pulled. :) It was about using Excell and CDO from .Net.

Mainly, when these articles do get out there, they're written by folks who
have nothing to do with messaging (in this case, it was a Visual Studio
person) who didn't run their article past us for review.

"Dan Mitchell" <djmit...@yahoo.com> wrote in message
news:Xns96B3804AFDEBEd...@207.46.248.16...

thomasandersen

unread,
Aug 17, 2005, 9:00:14 AM8/17/05
to
"DaveSam" <daves...@comcast.net> wrote in message
news:1124124732.5...@g49g2000cwa.googlegroups.com...

> Sorry, Dan, mixed up the names.
>
> I have been working with MAPI33, but ran into one problem...just
> thought I would give this a try.

Hi Dave,

If your still using MAPI33 you do it like this:

MAPI33.MapiRestrictions.Restriction startRestriction = new
MAPI33.MapiRestrictions.Compare(
MAPI33.Tags.PR_LAST_MODIFICATION_TIME,
MAPI33.MapiRestrictions.Compare.TYPES.GreaterOrEqual,
new MAPI33.MapiTypes.MapiSysTime(MAPI33.Tags.PR_LAST_MODIFICATION_TIME,
startDate)
);
MAPI33.MapiRestrictions.Restriction endRestriction = new
MAPI33.MapiRestrictions.Compare(
MAPI33.Tags.PR_LAST_MODIFICATION_TIME,
MAPI33.MapiRestrictions.Compare.TYPES.LessOrEqual,
new MAPI33.MapiTypes.MapiSysTime(MAPI33.Tags.PR_LAST_MODIFICATION_TIME,
endDate)
);
MAPI33.MapiRestrictions.Restriction restriction = new
MAPI33.MapiRestrictions.And(new MAPI33.MapiRestrictions.Restriction[]
{startRestriction, endRestriction});

Best regards,
Thomas Andersen


bing

unread,
Sep 27, 2011, 2:11:38 PM9/27/11
to
Anonym wrote on 08/17/2005 09:00 ET :
> "DaveSam" wrote in message
> news:
Hi there,

I am trying to restrict the results of a search by ClipEnd.

MAPINAMEIDInt mni;
mni = new MAPINAMEIDInt(new
Guid("00062002-0000-0000-C000-000000000046"), 0x8236,
TagTypes.TypeSysTime);

Tags clipEndTag = MAPI33.Helpers.Property.Tag(TagTypes.TypeSysTime,
(ushort)mni.id);

calendarTable.SetColumns(new Tags[] { Tags.ptagLongtermEntryId, clipEndTag },
IMAPITable.FLAGS.Default);

MAPI33.MapiRestrictions.Compare c1 = new
MAPI33.MapiRestrictions.Compare(clipEndTag,
MAPI33.MapiRestrictions.Compare.TYPES.GreaterOrEqual, Value.Create(clipEndTag,
DateTime.Now));
returnValue = calendarTable.Restrict(c1, IMAPITable.FLAGS.TblBatch);

But it always return null. I did something wrong? Can anyone point me in the
right direction?

Thanks


Bing
0 new messages