how to capture events for next item

  • Thread starter Thread starter Ashish
  • Start date Start date
Status
Not open for further replies.
A

Ashish

In outlook 2003, When open a mail there are 2 buttons in statndard menu

which are Next Item and Previous Item (in arrow symbol) in open mail window.

I am not able to capture events for these two buttons. Besides these i can

capture events for other buttons on standard menu. I can not know in my

addin when user click on these buttons. Their ids are 359 and 360.Please

suggest how to capture events for those.
 
Hallo Ashish,


> In outlook 2003, When open a mail there are 2 buttons in statndard menu
> which are Next Item and Previous Item (in arrow symbol) in open mail window.
> I am not able to capture events for these two buttons. Besides these i can
> capture events for other buttons on standard menu. I can not know in my
> addin when user click on these buttons. Their ids are 359 and 360.Please
> suggest how to capture events for those.


You can try to put references to the two buttons for e.g. in variables

(declared 'As Office.CommandbarButton') "btnID359" and "btnID360",

then hide the buttons (.Visible= False) and add your own buttons with

the same positions and FaceIDs. In the appropriated event procs of

your buttons do what you have to do and finally do call

"btnID359.Execute" or "btnID360.Execute" to run the original

functionallity. Just some theoretical thoughts, but worth a try i

think...

So long...

> ..Bomi


> !!! In case you want to reply via email please use Reply-To address and remove underscores (_) !!!
 
Thanks for this info.


> > then hide the buttons (.Visible= False) and add your own buttons with


Does it mean it is not possible to capture events for these buttons. Outlook

does not provide that?

"Heinz-Josef Bomanns" <NotForMail@t-online.de> wrote in message

news:lrfne5dgnsanoutcnebq322n2temkg52q2@4ax.com...
> Hallo Ashish,
>
> >In outlook 2003, When open a mail there are 2 buttons in statndard menu
> >which are Next Item and Previous Item (in arrow symbol) in open mail
> >window.
> >I am not able to capture events for these two buttons. Besides these i can
> >capture events for other buttons on standard menu. I can not know in my
> >addin when user click on these buttons. Their ids are 359 and 360.Please
> >suggest how to capture events for those.


> You can try to put references to the two buttons for e.g. in variables
> (declared 'As Office.CommandbarButton') "btnID359" and "btnID360",
> then hide the buttons (.Visible= False) and add your own buttons with
> the same positions and FaceIDs. In the appropriated event procs of
> your buttons do what you have to do and finally do call
> "btnID359.Execute" or "btnID360.Execute" to run the original
> functionallity. Just some theoretical thoughts, but worth a try i
> think...

>

> So long...
> ...Bomi
>
> > !!! In case you want to reply via email please use Reply-To address and
> > remove underscores (_) !!!
 
The problem is you are handling events for a specific

Inspector.CommandBars.CommandBarButton object. Clicking Next or Previous

will open a new Inspector in Outlook 2003.

Why do you need to handle events for those specific button clicks?

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

news:%230ag9piWKHA.3720@TK2MSFTNGP02.phx.gbl...
> Thanks for this info.
>
> >> then hide the buttons (.Visible= False) and add your own buttons with


> Does it mean it is not possible to capture events for these buttons.
> Outlook does not provide that?
 
Oh it means when we click on nexe/previous item a new inspector open.
> Why do you need to handle events for those specific button clicks?


Because when we click on next/previous button outlook first call

onnewinspector while another inspector is not close. After this outlook call

close inspector for another inspector. And the main problem is outlook never

call item_open event for new inspector.
<kenslovak@mvps.org> wrote in message

news:%23Mn3AN0WKHA.1268@TK2MSFTNGP04.phx.gbl...
> The problem is you are handling events for a specific
> Inspector.CommandBars.CommandBarButton object. Clicking Next or Previous
> will open a new Inspector in Outlook 2003.

> Why do you need to handle events for those specific button clicks?

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:%230ag9piWKHA.3720@TK2MSFTNGP02.phx.gbl...
> > Thanks for this info.
> >
> >>> then hide the buttons (.Visible= False) and add your own buttons with

>

>> Does it mean it is not possible to capture events for these buttons.
> > Outlook does not provide that?

>
 
Hallo Ashish,


> Does it mean it is not possible to capture events for these buttons. Outlook
> does not provide that?


Yes...


> "Heinz-Josef Bomanns" <NotForMail@t-online.de> wrote in message
> news:lrfne5dgnsanoutcnebq322n2temkg52q2@4ax.com...
> > Hallo Ashish,
> >
> >>In outlook 2003, When open a mail there are 2 buttons in statndard menu
> >>which are Next Item and Previous Item (in arrow symbol) in open mail
> >>window.
> >>I am not able to capture events for these two buttons. Besides these i can
> >>capture events for other buttons on standard menu. I can not know in my
> >>addin when user click on these buttons. Their ids are 359 and 360.Please
> >>suggest how to capture events for those.

>

>> You can try to put references to the two buttons for e.g. in variables
> > (declared 'As Office.CommandbarButton') "btnID359" and "btnID360",
> > then hide the buttons (.Visible= False) and add your own buttons with
> > the same positions and FaceIDs. In the appropriated event procs of
> > your buttons do what you have to do and finally do call
> > "btnID359.Execute" or "btnID360.Execute" to run the original
> > functionallity. Just some theoretical thoughts, but worth a try i
> > think...


So long...

> ..Bomi


> !!! In case you want to reply via email please use Reply-To address and remove underscores (_) !!!
 
How outlook calls its event when i open a mail and close it

open a mail, outlook call onnewinspector. In this i get

inspector.currentitem and registered events for current item.

Then outlook call item_open event, i add a attachment in current item but do

not call item->Save. Now when mail display it shows an attachment. After

this when i close this mail outlook call item_close. Here i delete that

attachment and call save function. After this outlook call inspector_close.

Now for the case when i click on next/previous item

open a mail, outlook call onnewinspector. In this i get

inspector.currentitem and registered events for current item.

Then outlook call item_open event, i add a attachment in current item but do

not call item->Save. Now when mail display it shows an attachment. When i

click on next button outlook call inspector_close (here it did not call

item_close). Then it call onnewinspector for next mail. After that outlook

call item_close for previous mail. And outlook does not call item_open for

next mail.

I have 2 problems here.

1. For next mail since i do not get item_open event so can not add a

attachment in next mail.

2. Since for this case outlook calls inspector_close event (did not call

item_close event and i add a attachment in mail, means i modify the mail )

so outlook prompts a message "Do you want to save".

Since item_close is not called, In inspector_close i delete attachment from

mail and save it but still outlook displays the message "Do you want to

save".

Thats why i ask how to register events for next/previous button. But since

it's not possible so is there any solution for that problem.
 
I don't really see a solution since you are changing items without saving

them. That will force the prompts. We've gone over various other problems

caused by this structure, about all I can think of other than not adding the

attachments or saving the items is to disable those buttons so they can't be

used.

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

news:emzFS%237WKHA.4704@TK2MSFTNGP02.phx.gbl...
> How outlook calls its event when i open a mail and close it

> open a mail, outlook call onnewinspector. In this i get
> inspector.currentitem and registered events for current item.
> Then outlook call item_open event, i add a attachment in current item but
> do not call item->Save. Now when mail display it shows an attachment.
> After this when i close this mail outlook call item_close. Here i delete
> that attachment and call save function. After this outlook call
> inspector_close.

> Now for the case when i click on next/previous item

> open a mail, outlook call onnewinspector. In this i get
> inspector.currentitem and registered events for current item.
> Then outlook call item_open event, i add a attachment in current item but
> do not call item->Save. Now when mail display it shows an attachment. When
> i click on next button outlook call inspector_close (here it did not call
> item_close). Then it call onnewinspector for next mail. After that
> outlook call item_close for previous mail. And outlook does not call
> item_open for next mail.

> I have 2 problems here.
> 1. For next mail since i do not get item_open event so can not add a
> attachment in next mail.
> 2. Since for this case outlook calls inspector_close event (did not call
> item_close event and i add a attachment in mail, means i modify the mail )
> so outlook prompts a message "Do you want to save".
> Since item_close is not called, In inspector_close i delete attachment
> from mail and save it but still outlook displays the message "Do you want
> to save".

> Thats why i ask how to register events for next/previous button. But since
> it's not possible so is there any solution for that problem.
>
 
Previous and next button and popup button. Under Previous/Next button there

are many control buttons. We can capture event for these control buttons not

for these popup button.

Does outlook not support to capture event for a popup button when it's

clicked.
<kenslovak@mvps.org> wrote in message

news:uUyazr8WKHA.844@TK2MSFTNGP05.phx.gbl...
> I don't really see a solution since you are changing items without saving
> them. That will force the prompts. We've gone over various other problems
> caused by this structure, about all I can think of other than not adding
> the attachments or saving the items is to disable those buttons so they
> can't be used.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:emzFS%237WKHA.4704@TK2MSFTNGP02.phx.gbl...
> > How outlook calls its event when i open a mail and close it
>

>> open a mail, outlook call onnewinspector. In this i get
> > inspector.currentitem and registered events for current item.
> > Then outlook call item_open event, i add a attachment in current item but
> > do not call item->Save. Now when mail display it shows an attachment.
> > After this when i close this mail outlook call item_close. Here i delete
> > that attachment and call save function. After this outlook call
> > inspector_close.
>

>> Now for the case when i click on next/previous item
>

>> open a mail, outlook call onnewinspector. In this i get
> > inspector.currentitem and registered events for current item.
> > Then outlook call item_open event, i add a attachment in current item but
> > do not call item->Save. Now when mail display it shows an attachment.
> > When i click on next button outlook call inspector_close (here it did not
> > call item_close). Then it call onnewinspector for next mail. After that
> > outlook call item_close for previous mail. And outlook does not call
> > item_open for next mail.
>

>> I have 2 problems here.
> > 1. For next mail since i do not get item_open event so can not add a
> > attachment in next mail.
> > 2. Since for this case outlook calls inspector_close event (did not call
> > item_close event and i add a attachment in mail, means i modify the
> > mail ) so outlook prompts a message "Do you want to save".
> > Since item_close is not called, In inspector_close i delete attachment
> > from mail and save it but still outlook displays the message "Do you want
> > to save".
>

>> Thats why i ask how to register events for next/previous button. But
> > since it's not possible so is there any solution for that problem.
> >

>
 
There are a number of different commandbar controls that MS uses that

outside programmers can't get at or use ourselves. As I said, I don't see a

solution to get those clicks.

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

news:efsgTnhXKHA.4068@TK2MSFTNGP06.phx.gbl...
> Previous and next button and popup button. Under Previous/Next button
> there are many control buttons. We can capture event for these control
> buttons not for these popup button.
> Does outlook not support to capture event for a popup button when it's
> clicked.
 
Hi Ashish,

I also had similar problem .. here is the solution which u got after 2 days

RnD :-)

include Ribbon xml file : (You will need to customize qat)

<ribbon startFromScratch="true"
<qat
<sharedControls
<button idMso="FileSave" /
<button id="PreviousAction" label="Previous"

supertip="Click to view previous email message"

imageMso="MessagePrevious"

onAction="Previous_Action" keytip="C" /
<button id="NextAction" label="Next"

supertip="Click to view next email message"

imageMso="MessageNext"

onAction="Next_Action" keytip="B" /
</sharedControls
</qat
</ribbon
Next_Action()

{

// do your action

//Call following to use default feature of Next arrow

Globals.ThisAddIn.Application.ActiveInspector().CommandBars.ExecuteMso("MessageNext");

}

same goes for previous action ..

Thanks!

Regards,

Sandeep Yadav

> .Net Developer

"Heinz-Josef Bomanns" wrote:


> Hallo Ashish,
>
> >Does it mean it is not possible to capture events for these buttons. Outlook
> >does not provide that?


> Yes...

>
> >"Heinz-Josef Bomanns" <NotForMail@t-online.de> wrote in message
> >news:lrfne5dgnsanoutcnebq322n2temkg52q2@4ax.com...
> >> Hallo Ashish,
> >
> >>>In outlook 2003, When open a mail there are 2 buttons in statndard menu
> >>>which are Next Item and Previous Item (in arrow symbol) in open mail
> >>>window.
> >>>I am not able to capture events for these two buttons. Besides these i can
> >>>capture events for other buttons on standard menu. I can not know in my
> >>>addin when user click on these buttons. Their ids are 359 and 360.Please
> >>>suggest how to capture events for those.
> >
> >> You can try to put references to the two buttons for e.g. in variables
> >> (declared 'As Office.CommandbarButton') "btnID359" and "btnID360",
> >> then hide the buttons (.Visible= False) and add your own buttons with
> >> the same positions and FaceIDs. In the appropriated event procs of
> >> your buttons do what you have to do and finally do call
> >> "btnID359.Execute" or "btnID360.Execute" to run the original
> >> functionallity. Just some theoretical thoughts, but worth a try i
> >> think...


>

> So long...
> ...Bomi
>
> > !!! In case you want to reply via email please use Reply-To address and remove underscores (_) !!!

> .
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A how to capture outlook 2007 events Outlook VBA and Custom Forms 4
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
R Capture Sender's Display name and Address Outlook VBA and Custom Forms 3
M Using field names to capture a data element Using Outlook 0
I Capture incoming emails Outlook VBA and Custom Forms 1
A Capture network traffic in IE to file Outlook VBA and Custom Forms 5
JorgeDario How to capture and save the text, when responding a MailItem? Outlook VBA and Custom Forms 3
G Capture "forward event" ? Outlook VBA and Custom Forms 11
J VBA Form in Outlook to capture data and complile a mail Outlook VBA and Custom Forms 2
B Capture Inbound E-mail Subject with VBA Outlook VBA and Custom Forms 4
R How to capture a Mailitem Event Outlook VBA and Custom Forms 3
T Some way to capture who marks an email as read Outlook VBA and Custom Forms 1
C Event Capture - Item Context Menu (Delete). Can you hook it? Outlook VBA and Custom Forms 1
F Show events in Monthly Calendar Using Outlook 3
Fozzie Bear Calendar Events created on iPhone have suddenly start sending invitations to attendees Using Outlook 2
J Calendar events created on iPhone automatically changing default alert from 'None' to 'Time of Event' Using Outlook.com accounts in Outlook 0
O After filtering, how to display all events on that day? Using Outlook 4
O Carriage Return - Line Feeds - exporting Calendar events Using Outlook 0
A Outlook Reminders not populating for certain events Using Outlook 2
J Outlook 2010 Changing events in Outlook calendar via opening file, importing CSV Using Outlook 0
P OWA Settings->Calendar->Events from Email; Setting changes do not hold Using Outlook 1
J Outlook Office 365 Win 10 how do I control background colors of events? Using Outlook 1
G Outlook VBA and Google Calendar ("Events") Outlook VBA and Custom Forms 1
N Using email notification to update calendar events? Outlook VBA and Custom Forms 4
P Outlook custom fields "events" Using Outlook 0
U Catching ModuleSwitch events after "open in new window" Outlook VBA and Custom Forms 2
T Categorizing different colors for a series of events Using Outlook 0
oliv- property "is printed" or catching print events Outlook VBA and Custom Forms 2
oliv- Best practice for catching mailitem.events Outlook VBA and Custom Forms 0
P Outlook 2013 Calendar events not appear on Outlook.com Calendar Using Outlook.com accounts in Outlook 6
V iCloud not syncing categorized calendar events Using Outlook 7
W All Events Disappear from Calendar Display Using Outlook 30
I Multiple events in single request Using Outlook 6
T Events Not Showing In Outlook Today Using Outlook 3
J Calendar view for future events only? Using Outlook 3
G Hiding All Day Events Using Outlook 1
microsvc Populating everyone's calendar with campus events Exchange Server Administration 1
Dave Godbey Sending Categories on Calendar Events Using Outlook 1
C Problem accessing events for folder "username" Server Threw Exception Using Outlook 1
S Syncing Past events from Outlook 2013 to Outlook.com Using Outlook.com accounts in Outlook 6
R How to turn OFF the Reminders for shared calendar events but not off personal Using Outlook 1
F Printing all day events only Using Outlook 3
E Outlook 2013 , iCloud linked calendar, events one hour ahead for about a month Using Outlook 5
B Timed events created in iPhone auto-change to All Day events in Outlook 2010 Using Outlook 2
H Events in Calendar not Bold Using Outlook 1
R [VBA] complicated(?) outlook events - need help with code Using Outlook 15
S Outlook - Reset the number of day-events Using Outlook 0
B Series of calendar events? Or Tasks? Using Outlook 1
D All New Appointments are All Day Events Using Outlook 1
P Printing calendar (work week) with numerous (i.e. >7) all day events... Using Outlook 3

Similar threads

Back
Top