Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sequential structure code Pin
DaveyM697-Apr-09 0:42
professionalDaveyM697-Apr-09 0:42 
QuestionInput data to label through textbox Pin
ciqing6-Apr-09 17:46
ciqing6-Apr-09 17:46 
AnswerRe: Input data to label through textbox Pin
Luc Pattyn6-Apr-09 17:52
sitebuilderLuc Pattyn6-Apr-09 17:52 
GeneralRe: Input data to label through textbox Pin
ciqing6-Apr-09 19:30
ciqing6-Apr-09 19:30 
GeneralRe: Input data to label through textbox Pin
Christian Graus6-Apr-09 20:01
protectorChristian Graus6-Apr-09 20:01 
GeneralRe: Input data to label through textbox Pin
ciqing6-Apr-09 20:37
ciqing6-Apr-09 20:37 
GeneralRe: Input data to label through textbox Pin
Luc Pattyn7-Apr-09 3:00
sitebuilderLuc Pattyn7-Apr-09 3:00 
QuestionPopup Outlook contact makes the WinForm stuck and hold Pin
manfree6-Apr-09 17:32
manfree6-Apr-09 17:32 
Hi all

I would like to popup an Outlook contact via a Click button. The "Popup action" works fine~
However, after the outlook contact comes up, the WinForm(Form1) seem stuck and hold ....
I can't move, minimize and maximize the WinForm ?????
Any body know what is the problem in here ??
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 Outlook = Microsoft.Office.Interop.Outlook;

namespace testing1
{
    public partial class Form1 : Form
    {
        Outlook.Application oApp = new Outlook.Application();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void FindContactEmailByName(string firstName, string lastName)
        {
            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)
        {
            FindContactEmailByName("Tom", "Lee");
        }

    }
}

AnswerRe: Popup Outlook contact makes the WinForm stuck and hold Pin
Shajeel6-Apr-09 21:12
Shajeel6-Apr-09 21:12 
GeneralRe: Popup Outlook contact makes the WinForm stuck and hold Pin
manfree6-Apr-09 22:00
manfree6-Apr-09 22:00 
QuestionHelp me Pin
janas996-Apr-09 17:19
janas996-Apr-09 17:19 
AnswerRe: Help me Pin
N a v a n e e t h6-Apr-09 17:45
N a v a n e e t h6-Apr-09 17:45 
AnswerRe: Help me on ProcessCmdKey Pin
12Code6-Apr-09 18:22
12Code6-Apr-09 18:22 
GeneralRe: Help me on ProcessCmdKey Pin
janas997-Apr-09 16:54
janas997-Apr-09 16:54 
GeneralRe: Help me on ProcessCmdKey Pin
12Code7-Apr-09 17:43
12Code7-Apr-09 17:43 
QuestionBreak a Method??? Pin
S K Y6-Apr-09 15:41
S K Y6-Apr-09 15:41 
AnswerRe: Break a Method??? Pin
N a v a n e e t h6-Apr-09 15:45
N a v a n e e t h6-Apr-09 15:45 
GeneralRe: Break a Method??? Pin
S K Y6-Apr-09 16:30
S K Y6-Apr-09 16:30 
GeneralRe: Break a Method??? Pin
N a v a n e e t h6-Apr-09 16:43
N a v a n e e t h6-Apr-09 16:43 
QuestionProblem with the ListView control [modified] Pin
Ankit Rajpoot6-Apr-09 14:55
Ankit Rajpoot6-Apr-09 14:55 
AnswerRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 15:20
sitebuilderLuc Pattyn6-Apr-09 15:20 
GeneralRe: Problem with the ListView control Pin
Ankit Rajpoot6-Apr-09 16:04
Ankit Rajpoot6-Apr-09 16:04 
AnswerRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 16:35
sitebuilderLuc Pattyn6-Apr-09 16:35 
GeneralRe: Problem with the ListView control Pin
Ankit Rajpoot6-Apr-09 17:28
Ankit Rajpoot6-Apr-09 17:28 
GeneralRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 17:47
sitebuilderLuc Pattyn6-Apr-09 17:47 

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.