How to know which button clicked

Status
Not open for further replies.
T

TmFnYXJhag

Hi,

I selected one mailItem in the Inbox. I selected New button. How can I know

programatically that I selected New button only.

Can anyone suggest me? Thanks in advance

Nagaraj Tadipatri
 
Handle Inspectors.NewInspector(), that event fires when you open a new item.

"Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message

news:3C315812-59B9-4960-BB0C-A54FA36C4226@microsoft.com...

> Hi,

> I selected one mailItem in the Inbox. I selected New button. How can I
> know
> programatically that I selected New button only.

> Can anyone suggest me? Thanks in advance

> > Nagaraj Tadipatri
 
Thanks Ken.

I have the following code in Inspectors.NewInspector()

if (this.Application.ActiveExplorer().Selection.Count > 0)

{

Object selObject =

this.Application.ActiveExplorer().Selection[1];

if (selObject is Outlook.MailItem)

{

Outlook.MailItem mailItem =

(selObject as Outlook.MailItem);

}

}

In the above code I want to know whether New button is clicked or not. How

to do this?

Nagaraj Tadipatri
wrote:


> Handle Inspectors.NewInspector(), that event fires when you open a new item.

> >

>

> "Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message
> news:3C315812-59B9-4960-BB0C-A54FA36C4226@microsoft.com...
> > Hi,
> > I selected one mailItem in the Inbox. I selected New button. How can I
> > know
> > programatically that I selected New button only.
> > Can anyone suggest me? Thanks in advance
> > > > Nagaraj Tadipatri


>
 
Does it really matter if the user clicked New or used Actions, New Mail

Message or whatever? They all result in opening a new item. If

Inspector.CurrentItem.EntryID is null it's a new item, if not then a

previously existing item was opened.

If that's really so important to you then you can get the New button

(wherever it exists) as a CommandBarButton and set up to handle its Click()

event. You'd drill down from Explorer.CommandBars to the Standard toolbar

(CommandBar) and FindControl to locate the New CommandBarButton, then handle

Click() on it.

"Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message

news:4898532D-ED41-4E2A-852A-228275270662@microsoft.com...
> Thanks Ken.

> I have the following code in Inspectors.NewInspector()

> if (this.Application.ActiveExplorer().Selection.Count > 0)
> {
> Object selObject =
> this.Application.ActiveExplorer().Selection[1];

> if (selObject is Outlook.MailItem)
> {
> Outlook.MailItem mailItem =
> (selObject as Outlook.MailItem);
> }

> }

> In the above code I want to know whether New button is clicked or not. How
> to do this?

> > Nagaraj Tadipatri
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
N Which Button Was Clicked on the Ribbonbar Menu Outlook VBA and Custom Forms 2
H Preventing the Send button from being clicked on an Outlook Form Outlook VBA and Custom Forms 1
N How to know New button is clicked Outlook VBA and Custom Forms 1
G Add Map It button to Custom Contacts Form in Outlook Outlook VBA and Custom Forms 1
J Outlook 2021 ScanPST errors (yet again ... sorry): repair button missing Outlook 2021 Using Outlook 5
S Outlook 2002- "Send" button has disappeared. Help please. Using Outlook 1
TomHuckstep Remove Send/Receive All Folders (IMAP/POP) button from Outlook 365 Ribbon Using Outlook 2
Witzker How to get the button Karte ( map) in custom contact form Outlook VBA and Custom Forms 2
J Want to create a button on the nav bar (module add-in) to run code Outlook VBA and Custom Forms 2
B How to create a button that sorts and selects the most recent message with ONE click Using Outlook 2
jehan2256 "History" button in Business Contact Manager Using Outlook 1
L "Insert Pictures" Button-Wrong Folder Using Outlook 5
O Replace hard returns with soft returns on selected text and button to QAT Using Outlook 5
bdsermons Outlook 365 command button in outlook form Outlook VBA and Custom Forms 5
J "Contact" button in Journal entry Using Outlook 1
O Outlook 2010 Add delete button to the side of the message list Using Outlook 1
I Button PDF in Outlook Contact custom form Outlook VBA and Custom Forms 1
D Outlook 2013 Macros only run in VB editor, not in drop down or button Outlook VBA and Custom Forms 14
Witzker HowTo start a macro with an Button in OL contact form Outlook VBA and Custom Forms 12
R Follow up button doesn't working neither the reminders in BCM BCM (Business Contact Manager) 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
K Disabling import/export button to restrict PST creation Using Outlook 3
E Can't accept or decline task (no button appears) Using Outlook 2
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
Q Prompt button to auto turn on Out of Office Outlook VBA and Custom Forms 3
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
Witzker Outlook 2010 Insert Date & Time at the button of an OL contactform in red Using Outlook 2
S How to set up button in ribbon for individual Quick Steps Using Outlook 1
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
J Command Button to stamp a date and time in a textbox in Outlook 2016 Outlook VBA and Custom Forms 3
A ScanPST finding errors but no Repair button Using Outlook 2
N Creating a button or link to a form in the Organizational Forms Library Outlook VBA and Custom Forms 3
J Execute Add-In Button from VBA Outlook 2016 Outlook VBA and Custom Forms 1
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
S Reminder Dialog Open Button Using Outlook 2
Wayne Dardis Calling Ribbon Button in Outlook 2016 Outlook VBA and Custom Forms 6
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
R Categorize Button in Quick Access Toolbar Disappears on New Email Using Outlook 1
S Problem running Command button code Outlook VBA and Custom Forms 2
E Button to change subject Outlook VBA and Custom Forms 1
S Shortcut/button to a Calendar Group Using Outlook 0
soadfan Enable all rules from toolbar button? Outlook VBA and Custom Forms 3
I Creating meeting invite with disabled tentative button Outlook VBA and Custom Forms 5
Diane Poremsky Contacts are missing when you click the To button Using Outlook 0
T Unable to 'Upload a file' using popup 'Browse' button Using Outlook 0
makinmyway ScanPST.exe Missing Repair Button Using Outlook 15
K Remove Manage APPS button for users Exchange Server Administration 1
J Send and Receive Button - only check default account? Using Outlook 1
A custom send button Outlook VBA and Custom Forms 3

Similar threads

Back
Top