2012-02-02 1 views
1

J'utilise l'application Windows OutlookAddIn1 (office-2007) dans VS2010, maintenant ma boîte de réception a des mails et chaque mail a des numéros de téléphone, maintenant ma tâche est de sélectionner le numéro de téléphone et cliquez avec le bouton droit de la souris, ou enregistrer l'option numéro apparaîtra comment il est possible et sélectionnez cette option stocker ce texte dans sql server2008 table de base de données pls aider mon idée sur ce sujet, pls donner une idée c'est tâche très urgentecomment stocker le numéro de téléphone de corps de texte d'aperçu (ou) la région choisie dans le serveur de sql using asp.net perspectives add ons?

Merci hemanth

Répondre

2
private void savenumbers() 
     { 
      try 
      { 
       Outlook.Application oApp; 
       Outlook.Explorer oExp; 
       Outlook.Selection oSel; 
       object oItem; 
       long i; 
       // TODO: On Error GoTo Warning!!!: The statement is not translatable 
       oApp = new Outlook.Application(); 
       oExp = oApp.ActiveExplorer(); 
       oSel = oExp.Selection; 
       if ((oSel.Count == 0)) 
       { 
        System.Windows.Forms.MessageBox.Show("Nothing selected"); 
        return; 
       } 
       for (i = 1; i <= oSel.Count; i++) 
       { 
        oItem = oSel[i]; 

        DisplayMessage(oItem); 
       } 
      } 


      catch (System.Exception ex) 
      { 
       System.Windows.Forms.MessageBox.Show("Error " + ex.Message.ToString()); 
      } 
     } 
     public int outlooksavenumber(string testcopy) 
     { 

      int ReturnValue = 0; 
      ReturnValue = SqlHelper.ExecuteNonQuery(LITRMSConnection, "usp_Outlooksavenumbers", 
                     new SqlParameter("@testcopy", testcopy)); 

      return ReturnValue; 
     } 

     void DisplayMessage(object oItem) 
     { 
      //Outlook.MailItem oMailItem; 
      Outlook.MailItem oMail = (Outlook.MailItem)oItem; 
      //System.Windows.Forms.MessageBox.Show(oMail.Subject); 
      //System.Windows.Forms.MessageBox.Show(oMail.Body); 
      string body = oMail.Body; 
      Outlook.Inspector inspector = oMail.GetInspector; 

      // Obtain the Word.Document object from the Inspector object 
      Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor; 

      // Copy the selected objects 
      string testcopy = ""; 
      testcopy = document.Application.Selection.Text; 

      outlooksavenumber(testcopy); 
     }   
Questions connexes