|
Hello i've tried to build it!
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)
{
this.Application.ItemContextMenuDisplay += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(PacktMenuItem_ItemContextMenuDisplay);
}
public void PacktMenuItem_ItemContextMenuDisplay(Microsoft.Office.Core.CommandBar PacktCommandBar, Microsoft.Office.Interop.Outlook.Selection Selection)
{
Office.CommandBarPopup callBarPopUp = (Office.CommandBarPopup)PacktCommandBar.Controls.Add(Office.MsoControlType.msoControlPopup, Type.Missing, "Custom Menu Item 1", PacktCommandBar.Controls.Count + 1, Type.Missing);
callBarPopUp.Tag = "PacktCustomMenuItem1";
callBarPopUp.Caption = "TAPI Call 1";
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)
{
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
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[^]
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....
|
|
|
|
|
csharpcomeintome wrote: Hello i've tried to build it!
Nice
csharpcomeintome wrote: Ho can i put these numbers instead Call xxxx!
Where are the numbers stored? You'll need to get them from somewhere "before" displaying the xxx-value.
csharpcomeintome wrote: And sorry for yesterday
Accepted, no problems here
|
|
|
|
|
Eddy Vluggen wrote: Where are the numbers stored? You'll need to get them from somewhere "before" displaying the xxx-value.
Ehm contacts are stored into my personal folder. Such as "Contatti itech". I'm italian .
Thanks for any help.
|
|
|
|
|
Not the contacts, but the replacement-phone numbers. If they're coming from an outlook-style address book, you'd have to look if the addin-framework supplies it's contents. Something like done in this article[^].
|
|
|
|
|
I'll print and study it. Thanks! Ehm i'm working hard on my tapi projet. I've created a chat/telephony client server using atapi julmar. And when done i'll sell it . If you interested i will give you my code
|
|
|
|
|
|
Ok. When i've finished it i'll try to explain in english it .
|
|
|
|
|
I'm getting maaaad!!
|
|
|
|
|
I've good idea. Ehm if i create a new region form into outlook that is visibile when i press a button in default ribbon?
|
|
|
|
|
Ehm i saw that article. Very useful! Ehm
Office.CommandBar cmdBar = cmdBars["Standard"];
What's standard in italian and english versions?
Thanks!
|
|
|
|
|
csharpcomeintome wrote: What's standard in italian and english versions?
Dunno for Italian, but the only translation I can offer for English is "default".
|
|
|
|
|
Unfortunately I can not do it ... EIU something simple? Or I did not understand where to go in Outlook to see the contact display ....?
|
|
|
|
|
csharpcomeintome wrote: Unfortunately I can not do it ...
Most examples deal with adding a new bar, not with "fetching" a reference to an existing one. I don't think that you can use that to get contacts' information, AFAIK it's a placeholder for buttons.
csharpcomeintome wrote: EIU something simple?
Extending Outlook is not simple - another good reason to be wanting an article on the subject
|
|
|
|
|
I have a document level application for Excel 2010 using VSTO and c#. The following code is used to call the Excel Growth function.
double[] known_Ys, new_Ys, known_Xs, new_Xs;
Excel.WorksheetFunction wsf = Application.WorksheetFunction;
object results = wsf.Growth(known_Ys, known_Xs, new_Xs, System.Type.Missing);
While debugging, "results" show a type of 'System.Object[*]' which is a System.Object[] with an undefined lower boundary.
Looking at the variable, there is an array of double values that appear to be correct. The lower boundary is 1, and the upper boundary is 5.
When attempting to cast the results to either object[] or double[], I get an exception, "Unable to cast object of type 'System.Object[*]' to type 'System.Object[]' or 'double[]'.
I've also unsuccessfully tried to use the static methods of the Array class to copy the contents out.
Any thoughts on a resolution would be appreciated.
I don't want to use VBA code to resolve the problem if it can be avoided.
I've also considered a work-around, using a hidden worksheet to perform the calculations and copying the results into the c# application, but feel I should be able to handle it in the c# code.
I found the following work-around, unless someone has a better solution.
"results" inherits from System.Array.
System.Array resultsArray = results as System.Array;
if (resultsArray != null)
{
int idx = resultsArray.GetLowerBound(0);
for (int i = 0; i < new_Ys.Length; i++)
{
new_Ys[i] = (double)resultsArray.GetValue(idx);
idx++;
}
return new_Ys;
}
else
{
return null;
}
The conflict is that c# vectors (one dimensional arrays) are always zero based, so explicit casts won't work.
modified 5-Nov-12 6:46am.
|
|
|
|
|
i have two panel in ma form. panel1 with button1 on it at location let say x:10,y:10 and panel2 with button 2 on it at location x:10,y:10.
what actually button1 do:- it hide panel1 and shows panel2 at the same location.
but whenever i click on button1 twice after completion its process it fire button2 click event,
plz help me ASAP
|
|
|
|
|
The problem is that the button click event is happening almost immediately - so the second "click" is going to the correct place - the control at that position on the "new" panel. And that will generate a click event for the new button because that is exactly what should happen.
If you want to stop it, then
1) Create a class level variable:
private DateTime lastSwap = DateTime.Now;
2) In the Button1 click handler, set it:
lastSwap = DateTime.Now; And then swap panels.
3) In the Button2 click handler, check it and ignore if too soon:
if (DateTime.Now < lastSwap.AddMilliseconds(500)) return;
You can change the 500 to any value you think reasonable - 500 provides half a second.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
hello,
thaks for your quick response...
code is working properly... but it is impossible to implement on big application where there are mre den 20,25 panels and every control takes diff diff tym to execute.
hope you get my point.
thanks once again.
|
|
|
|
|
neeraj@max wrote: are mre den
neeraj@max wrote: takes diff diff tym
neeraj@max wrote: hope you get my point.
No, not really. Try cutting out the childish txtspk and talk like a grown up.
|
|
|
|
|
hello,
thanks for your quick response...
code is working properly... but it is impossible to implement on big application where there are more then 20,25 panels and every control takes different time to execute.
hope you are getting my point.
thanks once again.
|
|
|
|
|
It's not impossible to implement, it's just going to take a while.
|
|
|
|
|
You're missing the point. As a programmer, when you find a solution to the problem, but you have 25 problems - you dont implement the solution 25 times. You implement it once and re-use it 25 times.
Think of it this way - if you have 25 customers, you dont write 25 different classes to represent each customer, you implement once class called "Customer" and reuse it 25 times. The same thing applies here, you need a solution which stops a button being clicked within 500ms of another button (personally I think this is an awful solution to your original problem, but hey if it works for you go with it). Write a class which exhibits this behaviour and attach it to every button which requires it.
|
|
|
|
|
@J4amieC
thanks for your 25 customer and single solution example...
but this solution is suitable for 2,3 panel only becuase
diffrent buttons have diffrent tasks and process time so we cant fix the 500ms for every event.
anyways i am looking for more suitable solution.....
if you come to know any, let me know.
|
|
|
|
|
The 500ms had nothing to do with whatever task the button does, it had to do with stopping a quick double click operating a button which appears after the first click. It should not matter what the second button does!
Anyway your original question asked about 2 panels, and you got a solution to the question as stated. Ask the right question, and you'll get the right answer.
|
|
|
|
|
http://www.youtube.com/watch?v=bpojl4XMweo&feature=g-upl
above link will explain you my problem very clearly.
|
|
|
|
|