Implementing Drag and drop events in outlook

Status
Not open for further replies.
A

Ashish

When drag a mail item and drop to some other folder item_add event is called

b'se an item is added to a folder.

But before item_add What's actual event for drag and drop in outlook?

Item_add event is called for all cases like saving a mail, sending a mail,

moving a mail.

But if i want to call item_add event for special case(drag and drop) then

what i need to do.
 
K

Ken Slovak - [MVP - Outlook]

There are no drag and drop events in the Outlook object model, as a look at

the Object Browser will tell you. You'd have to go down to the Windows

message hook level and hook all such messages using Win32 API calls and a

message hook.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:ObheBZX%23JHA.1252@TK2MSFTNGP04.phx.gbl...
> When drag a mail item and drop to some other folder item_add event is
> called b'se an item is added to a folder.

> But before item_add What's actual event for drag and drop in outlook?
> Item_add event is called for all cases like saving a mail, sending a mail,
> moving a mail.
> But if i want to call item_add event for special case(drag and drop) then
> what i need to do.
>
 
A

Ashish

Ok i think item_add event is enough to handle the case. But here there is a

problem.

When a new mail arrives application_newmail event(event number 0xfba7 in

c++) is called.And when move a mail from one folder to another folder then

also application_newmail event is called.

I'm facing the problem if a exchange user has some mails in its inbox and i

create profile for this user and login to user using outlook. Here

application_newmail event will call until it receives all mails in

inbox(outlook looks like hang until all mail receive). Is there any way to

recognize this case? Means can i set a bool which tells me that outlook has

received all mails and ready for any action now? When launch outlook

OnStartupComplete is called and return before outlook receive new mails. Is

there any other function which tells outlook is idle now.

Or can we differentiate in application_newmail event for the cases when new

mail arrive or move a mail from one folder to another.

Supp" - " <kenslovak@mvps.org> wrote in message

news:%23v5rKJY%23JHA.5040@TK2MSFTNGP04.phx.gbl...
> There are no drag and drop events in the Outlook object model, as a look
> at the Object Browser will tell you. You'd have to go down to the Windows
> message hook level and hook all such messages using Win32 API calls and a
> message hook.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:ObheBZX%23JHA.1252@TK2MSFTNGP04.phx.gbl...
> > When drag a mail item and drop to some other folder item_add event is
> > called b'se an item is added to a folder.
>

>> But before item_add What's actual event for drag and drop in outlook?
> > Item_add event is called for all cases like saving a mail, sending a
> > mail, moving a mail.
> > But if i want to call item_add event for special case(drag and drop) then
> > what i need to do.
> >

>
 
K

Ken Slovak - [MVP - Outlook]

If you are getting NewMail() in cases other than when email is delivered to

the Inbox of the primary mailbox then something is very wrong.

That event only fires in that case, and only then at intervals, allowing you

to miss incoming items.

A better event to use would be either Inbox.Items.ItemAdd() or NewMailEx().

NewMailEx() gives you a delimited list of the EntryID's of items that have

come in since the last time that event fired.

ItemAdd() has a limitation common to most MAPI events where it won't fire at

all if more than 16 items come in at once.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:OTgECH9%23JHA.3544@TK2MSFTNGP04.phx.gbl...
> Ok i think item_add event is enough to handle the case. But here there is
> a problem.

> When a new mail arrives application_newmail event(event number 0xfba7 in
> c++) is called.And when move a mail from one folder to another folder then
> also application_newmail event is called.
> I'm facing the problem if a exchange user has some mails in its inbox and
> i create profile for this user and login to user using outlook. Here
> application_newmail event will call until it receives all mails in
> inbox(outlook looks like hang until all mail receive). Is there any way to
> recognize this case? Means can i set a bool which tells me that outlook
> has received all mails and ready for any action now? When launch outlook
> OnStartupComplete is called and return before outlook receive new mails.
> Is there any other function which tells outlook is idle now.

> Or can we differentiate in application_newmail event for the cases when
> new mail arrive or move a mail from one folder to another.
 
A

Ashish

There are 2 newmail events in application. I dont know exact functions in

VB. I'm using c++.

newmail(0xf003) this is call when we create a new mail in outlook

newmailex(0xfba7) this is call when a new mail receives in outlook for

following cases

1. new mail receive in inbox folder

2. we create a new mail and save/send it

3. we move a mail from one folder to another folder

For all cases outlook first calls application_newmailex then Items.ItemAdd


> NewMailEx() gives you a delimited list of the EntryID's of items that have
> come in since the last time that event fired.


Please explain how EntryID's can help?

The critical case is if a exchange user has some mails already in it and we

create a new profile for this user in outlook and login to outlook then

application_newmailex and Items.ItemAdd will be call for all mails which

come to inbox until outlook restored all old mails.
<kenslovak@mvps.org> wrote in message

news:uKSGY79%23JHA.4560@TK2MSFTNGP05.phx.gbl...
> If you are getting NewMail() in cases other than when email is delivered
> to the Inbox of the primary mailbox then something is very wrong.

> That event only fires in that case, and only then at intervals, allowing
> you to miss incoming items.

> A better event to use would be either Inbox.Items.ItemAdd() or
> NewMailEx(). NewMailEx() gives you a delimited list of the EntryID's of
> items that have come in since the last time that event fired.

> ItemAdd() has a limitation common to most MAPI events where it won't fire
> at all if more than 16 items come in at once.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:OTgECH9%23JHA.3544@TK2MSFTNGP04.phx.gbl...
> > Ok i think item_add event is enough to handle the case. But here there is
> > a problem.
>

>> When a new mail arrives application_newmail event(event number 0xfba7 in
> > c++) is called.And when move a mail from one folder to another folder
> > then also application_newmail event is called.
> > I'm facing the problem if a exchange user has some mails in its inbox and
> > i create profile for this user and login to user using outlook. Here
> > application_newmail event will call until it receives all mails in
> > inbox(outlook looks like hang until all mail receive). Is there any way
> > to recognize this case? Means can i set a bool which tells me that
> > outlook has received all mails and ready for any action now? When launch
> > outlook OnStartupComplete is called and return before outlook receive new
> > mails. Is there any other function which tells outlook is idle now.
>

>> Or can we differentiate in application_newmail event for the cases when
> > new mail arrive or move a mail from one folder to another.

>
 
K

Ken Slovak - [MVP - Outlook]

You've lost me completely.

There are both NewMail() and NewMailEx() (for VB, VBA, VB.NET and C#). I

don't do C++ but my guess is that the event with the higher index is

NewMailEx(). However, both events should only fire when new mail is

delivered to the default Inbox in that Outlook profile.

If you are seeing anything else then you're seeing something that I've never

heard of in the Outlook object model and I have no idea what's going on.

Just look at the object model in the Object Browser in the Outlook VBA

project to see what I'm talking about.

NewMailEx() should only fire in case 1, never in your cases 2 & 3.

The list of EntryID's you get from NewMailEx() lets you access each new mail

that came in, which is what I thought we were talking about.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:ufAnNM%23%23JHA.4900@TK2MSFTNGP02.phx.gbl...
> There are 2 newmail events in application. I dont know exact functions in
> VB. I'm using c++.

> newmail(0xf003) this is call when we create a new mail in outlook
> newmailex(0xfba7) this is call when a new mail receives in outlook for
> following cases
> 1. new mail receive in inbox folder
> 2. we create a new mail and save/send it
> 3. we move a mail from one folder to another folder

> For all cases outlook first calls application_newmailex then Items.ItemAdd
>
> > NewMailEx() gives you a delimited list of the EntryID's of items that
> > have come in since the last time that event fired.


> Please explain how EntryID's can help?

> The critical case is if a exchange user has some mails already in it and
> we create a new profile for this user in outlook and login to outlook then
> application_newmailex and Items.ItemAdd will be call for all mails which
> come to inbox until outlook restored all old mails.
 
A

Ashish

You are correct it's NewMailEx(0xfba7) which is call when a new mail receive

in Inbox folder. Lets forget about NewMail(0xf003) it's not related here and

it's only call when we click on File->New Mail item in outlook.

NewMailEx is called when user receives new mails in its inbox folder. Or if

user already contains some mails and we create its profile in outlook. When

we login to user NewMailEx is call which receive all existing mails(which

are on server) in outlook.

But in my outlook(user profile is created using exchange server) NewMailEx

is also called when after creating a new mail we save it, or we move an

existing mail from one folder to another.

So i still dont know by which action item_add event is called.

I think the only way(as per myknowledge) is to implement drag and drop. You

have already said it should do using windows API. I think i should implement

drag and drop in active inspector. I dont know how to do it. Is there any

link available on net?
<kenslovak@mvps.org> wrote in message

news:u34LkV$%23JHA.1488@TK2MSFTNGP03.phx.gbl...
> You've lost me completely.

> There are both NewMail() and NewMailEx() (for VB, VBA, VB.NET and C#). I
> don't do C++ but my guess is that the event with the higher index is
> NewMailEx(). However, both events should only fire when new mail is
> delivered to the default Inbox in that Outlook profile.

> If you are seeing anything else then you're seeing something that I've
> never heard of in the Outlook object model and I have no idea what's going
> on. Just look at the object model in the Object Browser in the Outlook VBA
> project to see what I'm talking about.

> NewMailEx() should only fire in case 1, never in your cases 2 & 3.

> The list of EntryID's you get from NewMailEx() lets you access each new
> mail that came in, which is what I thought we were talking about.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:ufAnNM%23%23JHA.4900@TK2MSFTNGP02.phx.gbl...
> > There are 2 newmail events in application. I dont know exact functions in
> > VB. I'm using c++.
>

>> newmail(0xf003) this is call when we create a new mail in outlook
> > newmailex(0xfba7) this is call when a new mail receives in outlook for
> > following cases
> > 1. new mail receive in inbox folder
> > 2. we create a new mail and save/send it
> > 3. we move a mail from one folder to another folder
>

>> For all cases outlook first calls application_newmailex then
> > Items.ItemAdd
> >
> >> NewMailEx() gives you a delimited list of the EntryID's of items that
> >> have come in since the last time that event fired.

>

>> Please explain how EntryID's can help?
>

>> The critical case is if a exchange user has some mails already in it and
> > we create a new profile for this user in outlook and login to outlook
> > then application_newmailex and Items.ItemAdd will be call for all mails
> > which come to inbox until outlook restored all old mails.

>
 
K

Ken Slovak - [MVP - Outlook]

You'd have to research that yourself, I'm not familiar with any such

examples.

I can see NewMailEx() firing when items are downloaded from the Exchange

server on startup only if the profile is cached. If online the items are

already there in Inbox. I still have no idea why you'd see that event in the

other circumstances you mention.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:eBrTe4h$JHA.1488@TK2MSFTNGP03.phx.gbl...
> You are correct it's NewMailEx(0xfba7) which is call when a new mail
> receive in Inbox folder. Lets forget about NewMail(0xf003) it's not
> related here and it's only call when we click on File->New Mail item in
> outlook.
> NewMailEx is called when user receives new mails in its inbox folder. Or
> if user already contains some mails and we create its profile in outlook.
> When we login to user NewMailEx is call which receive all existing
> mails(which are on server) in outlook.

> But in my outlook(user profile is created using exchange server) NewMailEx
> is also called when after creating a new mail we save it, or we move an
> existing mail from one folder to another.
> So i still dont know by which action item_add event is called.
> I think the only way(as per myknowledge) is to implement drag and drop.
> You have already said it should do using windows API. I think i should
> implement drag and drop in active inspector. I dont know how to do it. Is
> there any link available on net?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
K Implementing an AND logic rule in OUTLOOK Using Outlook 1
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 14
R PST->Outlook.com (Import vs Drag-n-Drop methods Using Outlook.com accounts in Outlook 2
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
K Cannot consistently drag and drop .msg files into Outlook 2010 Using Outlook 0
F Tumblr - Drag & Drop files (pictures) into Outlook? Using Outlook 12
C Cannot drag and drop or create folder in PST file folders Using Outlook 1
S Renaming while drag and dropping to file Using Outlook 1
Forum Admin Wishlist Drag and drop email to a calendar date Outlook Wishlist 1
L Copying Emails using drag and drop Using Outlook 2
B Right click-drag no longer creates hyperlinks Using Outlook 2
V Drag and drop into Outlook folders Using Outlook 2
T drag drop/opening drop down/single click acts like double/highlighting Using Outlook 7
T Can not drag e-mails from search to folders Using Outlook 1
R Outlook 2007 - drag drop email to Explorer Using Outlook 1
J Problem using drag and drop to attach an html email in Outlook 2010 Using Outlook 18
S cannot drag emails to personal folders BCM (Business Contact Manager) 1
H Drag and Drop Outlook mails into a Windows Form Control with eml extension Outlook VBA and Custom Forms 1
A turn Outlook into a Drag-and-drop application Outlook Wishlist 2
M Drag and drop Outlook VBA and Custom Forms 1
N Drag and drop attachment in outlook addin Outlook VBA and Custom Forms 4
S Drag-and-drop to Custom Task Pane Outlook VBA and Custom Forms 2
P Drag and Drop mails from Outlook to Clarion6 Application Outlook VBA and Custom Forms 5
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
D Outlook 2013 Macros only run in VB editor, not in drop down or button Outlook VBA and Custom Forms 14
Z See "Change View" Drop Down as a List? Using Outlook 1
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
D BCM 2013 not functioning as BCM 2010 Example no drop down for communications history Using Outlook 0
M Same file "stuck" on top of file list in "Attach File" drop down Using Outlook 4
A Automatically send email based on drop-down field? Outlook VBA and Custom Forms 2
Diane Poremsky No drop down calendars in Outlook 2010 Print Options Using Outlook 0
P BCM 2013 Contacts Form Drop Down Box Bug BCM (Business Contact Manager) 1
P Field in Forms displayed depending on the Item chosen from drop-down-list BCM (Business Contact Manager) 1
M Add custom locations to Outlook Forms "Look In:" drop-down list Using Outlook 5
M How do I link a drop down box to a percent complete box Using Outlook 4
R Display multiple accounts as drop down in the from field in New Mail Using Outlook 1
S Outlook addin formregion as a drop down Outlook VBA and Custom Forms 6
S RE: Template with drop down Outlook VBA and Custom Forms 3
C Drop Down Box in Email Template Outlook VBA and Custom Forms 2

Similar threads

Top