Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 如何使用asp.net outlook加载项在sql server中存储outlook正文电话号码(或)选定区域?_Sql Server 2008_Asp.net 4.0_Outlook Addin_Outlook 2007 - Fatal编程技术网

Sql server 2008 如何使用asp.net outlook加载项在sql server中存储outlook正文电话号码(或)选定区域?

Sql server 2008 如何使用asp.net outlook加载项在sql server中存储outlook正文电话号码(或)选定区域?,sql-server-2008,asp.net-4.0,outlook-addin,outlook-2007,Sql Server 2008,Asp.net 4.0,Outlook Addin,Outlook 2007,我正在VS2010中使用windows应用程序Outlook Add 1(office-2007),现在我的收件箱中有一些邮件,每封邮件都有电话号码,现在我的任务是选择电话号码并单击鼠标右键,我有“保存文本”或“保存数字”选项将显示如何可能,并选择该选项将文本存储到sql Server 2008数据库表中。请帮助我的任何人了解该主题,请告诉我这是一项非常紧迫的任务 谢谢你 hemanth私有void savenumbers() { 尝试 { 应用oApp; Outlook.Explorer oE

我正在VS2010中使用windows应用程序Outlook Add 1(office-2007),现在我的收件箱中有一些邮件,每封邮件都有电话号码,现在我的任务是选择电话号码并单击鼠标右键,我有“保存文本”或“保存数字”选项将显示如何可能,并选择该选项将文本存储到sql Server 2008数据库表中。请帮助我的任何人了解该主题,请告诉我这是一项非常紧迫的任务

谢谢你 hemanth

私有void savenumbers()
{
尝试
{
应用oApp;
Outlook.Explorer oExp;
Outlook.oSel;
对象项目;
龙我;
//TODO:错误时转到警告!!!:该语句不可翻译
oApp=新建Outlook.Application();
oExp=oApp.ActiveExplorer();
oSel=oExp.Selection;
如果((oSel.Count==0))
{
System.Windows.Forms.MessageBox.Show(“未选择任何内容”);
返回;
}
对于(i=1;i
 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);
        }