如何从Outlook访问数据库 [英] How access a database from Outlook

查看:366
本文介绍了如何从Outlook访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

首先我是VSTO的新手

First I'm completely newbie with VSTO

我想这样:


  1. 从Outlook中打开一个窗口,在此窗口中必须出现来自SQL Server数据库的联系人列表
  2. 在邮件窗口中(当您执行"新电子邮件"时所拥有的窗口),在"收件人"下面。和"Cc"和"Cc"。有一个名为"From DB"的按钮。允许我(作为"To","Cc"和"密件抄送")选择来自此SQL Server数据库的联系人。

该插件适用于Outlook 2007.但我将开始使用VS2010 + Office 2010在我的开发PC上开发。

The plug-in is for Outlook 2007. But I'll start to develop on my develpment PC with VS2010 + Office 2010.

你能给出一个好的开头,可能是样品,可能是代码:)

Could you give a good point the start, may be sample, may be code :)

谢谢,

 

 

推荐答案

您好,

听起来您希望通过添加控件(例如显示数据库中的联系人的下拉列表)来扩展默认邮件撰写窗口。你可以做到这一点,但它需要一些提升和一些工作。

It sounds like you want to extend the default mail compose window by adding controls such as a drop down list that displays contacts from a database. You can do this, but it will take some ramp up and a little bit of work.

最有可能的是,你需要在Outlook中设计一个表单区域,然后将表单导入到VSTO Outlook加载项项目,您可以将新控件连接到数据。

Most likely, you will want to design a form region in Outlook and then import the form into a VSTO Outlook add-in project where you can hook up the new controls to data.

如果没有为每个单独的任务实际提供分步指导,我将提供一些粗粒步骤和一些链接更多信息。

Without actually providing step by step guidance for each individual task, i will provide some coarse grain steps and some links to more information.

步骤1.通过设计基于邮件撰写表单的表单区域,获取您想要的邮件表单。以下主题向您展示如何使用任务表单执行类似操作 -
http:// msdn.microsoft.com/en-us/library/bb608611.aspx 功能。请注意,您在Outlook中打开一个新的邮件撰写表单,然后在窗口的"开发人员"选项卡中,单击
设计此表单,您将能够复制所有控件设计师。然后,当您设计新的表单区域时,可以将这些控件粘贴到设计器上并添加其他控件。

Step 1. Get the mail form looking like you want by designing a form region that is based on a mail compose form. The following topic shows you how to do something similar by using a task form - http://msdn.microsoft.com/en-us/library/bb608611.aspx.  Note that you open a new mail compose form in Outlook and then in the Developer tab of the window, you click Design this form, you will be able to copy all of the controls on the designer. Then when you design the new form region, you can paste those controls onto the designer and add your additional controls.

步骤2.保存新的表单区域(.ofs文件)然后将该区域导入Outlook 2007或Outlook 2010项目。然后,您可以添加代码以填充控件或响应事件。同样,本文通过使用类似的
方案显示了一个示例 - http://msdn.microsoft .com / zh-cn / library / bb608611.aspx

Step 2. Save off the new form region (.ofs file) and then import that form region into an Outlook 2007 - or - Outlook 2010 project. You can then add code to populate the controls or respond to events. Again, this article shows an example by using a similar scenario - http://msdn.microsoft.com/en-us/library/bb608611.aspx.

有关使用邮件的一些说明性示例,请参阅此主题 -
http://msdn.microsoft.com/en-us/library/bb157889.aspx

For some illustrative examples of working with mail items, see this topic - http://msdn.microsoft.com/en-us/library/bb157889.aspx.

这应该提供一个起点。


这篇关于如何从Outlook访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆