Click here to Skip to main content
15,885,365 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a button in the context menu for each selected contact. Pin
J4amieC5-Nov-12 3:28
J4amieC5-Nov-12 3:28 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini5-Nov-12 5:21
Cristian Capannini5-Nov-12 5:21 
GeneralWhy I nominated your account as abusive. Pin
Pete O'Hanlon5-Nov-12 5:07
mvePete O'Hanlon5-Nov-12 5:07 
GeneralRe: Why I nominated your account as abusive. Pin
Cristian Capannini5-Nov-12 5:20
Cristian Capannini5-Nov-12 5:20 
GeneralRe: Why I nominated your account as abusive. Pin
Pete O'Hanlon5-Nov-12 5:24
mvePete O'Hanlon5-Nov-12 5:24 
GeneralRe: Why I nominated your account as abusive. Pin
Cristian Capannini5-Nov-12 5:26
Cristian Capannini5-Nov-12 5:26 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen5-Nov-12 3:14
professionalEddy Vluggen5-Nov-12 3:14 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini5-Nov-12 21:46
Cristian Capannini5-Nov-12 21:46 
Hello i've tried to build it!
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Core;

namespace PluginTapiProva1
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            // Custom context menu item event managed
            this.Application.ItemContextMenuDisplay += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(PacktMenuItem_ItemContextMenuDisplay);
        }

        // Context menu item adding procedure
        public void PacktMenuItem_ItemContextMenuDisplay(Microsoft.Office.Core.CommandBar PacktCommandBar, Microsoft.Office.Interop.Outlook.Selection Selection)
        {
            // Commadbarpopup control to context menu item
            Office.CommandBarPopup callBarPopUp = (Office.CommandBarPopup)PacktCommandBar.Controls.Add(Office.MsoControlType.msoControlPopup, Type.Missing, "Custom Menu Item 1", PacktCommandBar.Controls.Count + 1, Type.Missing);
            // Set the tag value for the menu
            callBarPopUp.Tag = "PacktCustomMenuItem1";
            // Caption for the context menu item
            callBarPopUp.Caption = "TAPI Call 1";
            // Set it to visible
            callBarPopUp.Visible = true;

            Office.CommandBarButton callButton2 = (Office.CommandBarButton)callBarPopUp.Controls.Add(1, missing, missing, missing, true);
            callButton2.Caption = "Call xxxx!";
            callButton2.Click += new Office._CommandBarButtonEvents_ClickEventHandler(Callxx);
        }

        public void Callxx(CommandBarButton Ctrl, ref bool CancelDefault)
        {
            // i want send selected number of a specific contact card how can i do it?
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {

        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}


And i'll get it:

http://i46.tinypic.com/29yox3n.jpg[^]

SQL
Ho can i put these numbers instead Call xxxx! To call function and pass number i've selected?
How can i load all numbers of selected contact to popup? And when i click it call a function passing the selected number?? Thanks! Thanks for any help!! :D And sorry for yesterday i was almost nervous....

GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen5-Nov-12 23:40
professionalEddy Vluggen5-Nov-12 23:40 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini5-Nov-12 23:44
Cristian Capannini5-Nov-12 23:44 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen5-Nov-12 23:54
professionalEddy Vluggen5-Nov-12 23:54 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 0:16
Cristian Capannini6-Nov-12 0:16 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen6-Nov-12 0:23
professionalEddy Vluggen6-Nov-12 0:23 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 0:35
Cristian Capannini6-Nov-12 0:35 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 4:57
Cristian Capannini6-Nov-12 4:57 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 21:24
Cristian Capannini6-Nov-12 21:24 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 2:40
Cristian Capannini6-Nov-12 2:40 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen6-Nov-12 2:42
professionalEddy Vluggen6-Nov-12 2:42 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Cristian Capannini6-Nov-12 2:46
Cristian Capannini6-Nov-12 2:46 
GeneralRe: Create a button in the context menu for each selected contact. Pin
Eddy Vluggen6-Nov-12 3:04
professionalEddy Vluggen6-Nov-12 3:04 
QuestionProblem with Excel WorksheetFunction.Growth in c# Pin
Ross R4-Nov-12 23:17
Ross R4-Nov-12 23:17 
Questionavoid double click Pin
neeraj@max4-Nov-12 20:06
neeraj@max4-Nov-12 20:06 
AnswerRe: avoid double click Pin
OriginalGriff4-Nov-12 20:34
mveOriginalGriff4-Nov-12 20:34 
GeneralRe: avoid double click Pin
neeraj@max4-Nov-12 21:09
neeraj@max4-Nov-12 21:09 
GeneralRe: avoid double click Pin
J4amieC4-Nov-12 21:27
J4amieC4-Nov-12 21:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.