Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
GeneralRe: Status bar Pin
Sajjad Leo7-Apr-09 1:39
Sajjad Leo7-Apr-09 1:39 
GeneralRe: Status bar Pin
Henry Minute7-Apr-09 2:02
Henry Minute7-Apr-09 2:02 
AnswerRe: Status bar [modified] Pin
12Code7-Apr-09 3:59
12Code7-Apr-09 3:59 
Questionhow to get the currency value from a website to local database Pin
gnanam.abraham7-Apr-09 0:50
gnanam.abraham7-Apr-09 0:50 
AnswerRe: how to get the currency value from a website to local database Pin
Vikram A Punathambekar7-Apr-09 1:02
Vikram A Punathambekar7-Apr-09 1:02 
AnswerRe: how to get the currency value from a website to local database Pin
Tom Deketelaere7-Apr-09 1:10
professionalTom Deketelaere7-Apr-09 1:10 
AnswerRe: how to get the currency value from a website to local database Pin
Christian Graus7-Apr-09 1:21
protectorChristian Graus7-Apr-09 1:21 
QuestionCannot open 2 or more outlook contact detail Pin
manfree7-Apr-09 0:38
manfree7-Apr-09 0:38 
Hi all,

The following code can popup a particular Outlook contact detail
Click button 1, it opens Tom Lee contact detail
Then, close the Tom Lee contact detail
Click button 2, it opens Sam Green contact detail
It works fine ...

However, if I am going to open both contact detail (without closing the other person contact)
it will come up with an error >>> "A dialog box is open. Close it and try again"

Any body knows how to solve it ?? Thanks

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace testing1
{
    public partial class Form1 : Form
    {
        Outlook.Application oApp = new Outlook.Application();
        string firstName;
        string lastName;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        
        private void FindContactEmailByName() {

            //firstName = args1;
            //lastName = args2;
            Outlook.NameSpace outlookNameSpace = oApp.GetNamespace("MAPI");
            Outlook.MAPIFolder contactsFolder = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderContacts);

            Outlook.Items contactItems = contactsFolder.Items;
            try
            {
                Outlook.ContactItem contact = (Outlook.ContactItem)contactItems.Find(String.Format("[FirstName]='{0}' and " + "[LastName]='{1}'", firstName, lastName));
                
                if (contact != null)
                {
                    contact.Display(true);
                }
                else
                {
                    MessageBox.Show("The contact information was not found.");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            /**/
        }
        private void button1_Click(object sender, EventArgs e)
        {
            firstName = "Tom";
            lastName = "Lee";
            popup();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            firstName = "Peter";
            lastName = "Green";
            popup();
        }
        void popup() {
            Thread th = new Thread(FindContactEmailByName);
            th.Start();
        }
    }
}

QuestionHow to Create a setup file in c#.net3.5 windows application Pin
Narendra Reddy Vajrala7-Apr-09 0:14
Narendra Reddy Vajrala7-Apr-09 0:14 
AnswerRe: How to Create a setup file in c#.net3.5 windows application Pin
stancrm7-Apr-09 0:25
stancrm7-Apr-09 0:25 
GeneralRe: How to Create a setup file in c#.net3.5 windows application Pin
Narendra Reddy Vajrala7-Apr-09 0:56
Narendra Reddy Vajrala7-Apr-09 0:56 
GeneralRe: How to Create a setup file in c#.net3.5 windows application Pin
Henry Minute7-Apr-09 2:05
Henry Minute7-Apr-09 2:05 
GeneralRe: How to Create a setup file in c#.net3.5 windows application Pin
Narendra Reddy Vajrala7-Apr-09 2:31
Narendra Reddy Vajrala7-Apr-09 2:31 
GeneralRe: How to Create a setup file in c#.net3.5 windows application Pin
Henry Minute7-Apr-09 11:40
Henry Minute7-Apr-09 11:40 
QuestionCalculate the age in years,months and days using the datetimepicker. Pin
Schdev7-Apr-09 0:10
Schdev7-Apr-09 0:10 
AnswerRe: Calculate the age in years,months and days using the datetimepicker. Pin
stancrm7-Apr-09 0:27
stancrm7-Apr-09 0:27 
AnswerRe: Calculate the age in years,months and days using the datetimepicker. Pin
DaveyM697-Apr-09 1:02
professionalDaveyM697-Apr-09 1:02 
AnswerRe: Calculate the age in years,months and days using the datetimepicker. Pin
Henry Minute7-Apr-09 1:04
Henry Minute7-Apr-09 1:04 
AnswerRe: Calculate the age in years,months and days using the datetimepicker. Pin
Luc Pattyn7-Apr-09 3:50
sitebuilderLuc Pattyn7-Apr-09 3:50 
QuestionWriting to ListBox from multiple threads Pin
Bruce Coward7-Apr-09 0:00
Bruce Coward7-Apr-09 0:00 
AnswerRe: Writing to ListBox from multiple threads Pin
Nicholas Butler7-Apr-09 0:52
sitebuilderNicholas Butler7-Apr-09 0:52 
GeneralRe: Writing to ListBox from multiple threads Pin
Bruce Coward7-Apr-09 1:04
Bruce Coward7-Apr-09 1:04 
GeneralRe: Writing to ListBox from multiple threads Pin
Nicholas Butler7-Apr-09 1:19
sitebuilderNicholas Butler7-Apr-09 1:19 
GeneralRe: Writing to ListBox from multiple threads Pin
Luc Pattyn7-Apr-09 3:53
sitebuilderLuc Pattyn7-Apr-09 3:53 
AnswerRe: Writing to ListBox from multiple threads Pin
Henry Minute7-Apr-09 1:15
Henry Minute7-Apr-09 1:15 

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.