|
What is best way to develope MS Office solution for Excel 2003 using vs 2010 C#.
|
|
|
|
|
The quality of the answers you get is directly determined by the quality of the question you ask!
Open Visual Studio and start a new "Excel 2007 Add-In" or "Excel 2007 Template" project depending on what you want to do, then start coding.
|
|
|
|
|
I would but that will not work with office 2003!! using vs 2010, Slick. 
|
|
|
|
|
Whoops! Sorry, I missing that little detail!
You can't do it. Office 2003 is only targetable by VSTO 2005 which is only compatible with Visual Studio 2005 or 2008.
You cannot use Visual Studio 2010.
|
|
|
|
|
|
Create a Primary Interop Assembly (PIA) for Excel 2003, add it to the references of your project, and start coding.
|
|
|
|
|
For some reason, my seed is different, but it's still returning random numbers that are all 0. Here's the code. Any idea how to fix it? I want it to return 0 or 1.
private void btn_Program_Click(object sender, EventArgs e)
{
DateTime CurrTime = DateTime.Now;
int seed = CurrTime.Hour + CurrTime.Minute + CurrTime.Second;
Console.WriteLine("seed is" + Convert.ToString(seed));
Random randomNum = new Random(seed);
int randomNumber = randomNum.Next(0,1);
Console.WriteLine("Random Number Program Result: " + Convert.ToString(randomNumber));
}
The output for a couple of Program button clicks is:
seed is96
Random Number Program Result: 0
seed is50
Random Number Program Result: 0
|
|
|
|
|
Your call to Next:
int randomNumber = randomNum.Next(0,1);
will always return 0 because the lower limit (0) is INCLUSIVE, meaning it will be included in the possible range of values and the upper limit (1) is EXCLUSIVE, meaning that it will NOT be included in the range of possible values.
So, since Next always return an integer (whole number) and your result set goes from 0 to 0, your code will always return 0.
To return 0 or 1, you have to change the range to:
int randomNumber = randomNum.Next(0,2);
Try reading the documentation on Random.Next(int32, int32)[^].
If you want decimal values greater than or equal to 0 and LESS THAN (NOT EQUAL TO!) 1, you'll have to call Random.Double() instead. This will, of course, return a number of type double , not int .
Oh! and your "seed" value sucks if you're looking for anything close to "true" randomness. You're limiting yourself to only 936,000 different sequences of pseudo-random numbers.
Since the default constructor of Random will initialize the generator with the value in the system clock, it has the capability of generating 4.2 billion different random number sequences.
modified 8-Jun-12 14:08pm.
|
|
|
|
|
Dave Kreskowiak wrote: "seed" value sucks if you're looking for anything close to "true" randomness
I agree. He should also toss the day of the month in there as well, and if savvy enough with some assembly programming, grab the lower 32 bits of the RDTSC instruction (or play around with the QueryPerformanceCounter ) as well, that could lean in the direction of a bit more "random" seed...
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
MichCl wrote: Random randomNum = new Random(seed);
And that should be a field (perhaps static), not a metthod variable.
|
|
|
|
|
Hi CodeProject World,
How can i use TAPI for PBX via C# .
I wanna to have Caller Id and Transfer and Make Call from my PBX via TAPI and C#.
i have three line 101,102,103 from my PBX and 4 line in coming into PBX.
i have connected line 103 via Phone wire to my computer Modem .
We have 3 computers in our work office and all have connected to PBX via Modem .
Thanks in advanced !
|
|
|
|
|
TAPI might not come into play with this at all.
You have to dig out the documentation on your PBX system and find out if it exposes some kind of interface over that modem connection or some other connection you can use.
|
|
|
|
|
|
You linked to a Wiki page, not to an actual application or article.
That page lists a few drivers for specific PBX's. Do you have one of those??
This is where YOU do research, based on what YOU have and what YOU know. I'm not doing it for you and chances are really good that you're not going to find example code for exactly what you're looking for.
|
|
|
|
|
So what is the solution.isnt it possible.(I have panasonic PBX).
can i use kdtele OCX for this.?
Help plz.
Thanks in advanced.
|
|
|
|
|
Is it possible?? YES!
It is possible on YOUR system? I have no idea!
YOU have to dig out your documentation to verify it and start researching yourself.
Interfacing with a PBX is not a common task, so you're not going to find a whole ton of experience and sample code out there. But, you can probably start with Googling for "".
C# PBX Integration[^]
|
|
|
|
|
thanks for your attention.
I have googled a lot but .......
I just wanna control the phone line which is coming out of PBX to my computer modem .
make call,transfer call,..
the same thing that my central phone done.
|
|
|
|
|
I have no idea and I'm not doing all the research for you. That's what YOU are getting paid to do.
|
|
|
|
|
|
If your'e looking to be spoon fed, you're not going to get it.
I've already given what you need to get started. This is where YOU TEACH YOURSELF something new.
|
|
|
|
|
I am using system.web.mail in windowsform to send mails on a ssl webmail of a service for certified mails. The problem is that the mails are not saved in the sentItems. Is there anyway to dio that? (Thanks)
here is the code:
System.Web.Mail.MailMessage newMail = new System.Web.Mail.MailMessage();
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtps.pec.aruba.it");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", "2");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "xxxxxxxxxxxxx@pec.it");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "yyyyyyyyyyyyyyy")
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
newMail.From = "xxxxxxxxxxxxx@pec.it");
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/savesentitems", "true");
newMail.To = dataGridView2.Rows[i].Cells[0].Value.ToString().Trim();
newMail.Subject = textOggetto.Text;
newMail.BodyFormat = System.Web.Mail.MailFormat.Html;
newMail.Body = editor.BodyHtml;
System.Web.Mail.SmtpMail.SmtpServer = "smtps.pec.aruba.it:465";
System.Web.Mail.SmtpMail.Send(newMail);
|
|
|
|
|
AFAIK it will not save it in Sent Mail because you are not using a mail application (for example Outlook) to send the mail.
Your code sends the mail in the background instead of using a mail client (for example Outlook). The mail client keeps track of sent and received items.
What I can suggest, if you need to account for sent mails, is to log the items to a flat file or db.
|
|
|
|
|
Thanks for your reply, I have searched for a way to save a message object in .eml file, but I found nothing. Any help? Thanks a lot!
|
|
|
|
|
Have a look at this code project article.
I have not tried it but it seems to be what you are after.
|
|
|
|
|
You use SMTP, not IMAP. With SMTP, the mail will not be copied to the "sent" folder on the mail server. You could add your own email address in the cc or bcc field to get a copy to yourself.
|
|
|
|