将 Microsoft Outlook 与我自己的数据同步? [英] Sync Microsoft Outlook with my own data?

查看:25
本文介绍了将 Microsoft Outlook 与我自己的数据同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 VB.Net,我需要从 Microsoft Outlook 2007 PST 文件和外部数据库中读取数据,并同步这两个源.

Using VB.Net, I need to read data from a Microsoft Outlook 2007 PST file and an external database, and sync the two sources.

过去在 SO 上的帖子提到了 Microsoft.Office.Interop.Outlook.我想知道 VB.Net 开发人员是否已经成功地使用它来处理 Outlook,或者我是否应该尝试其他解决方案.

Past posts on SO mention Microsoft.Office.Interop.Outlook. I was wondering if VB.Net developers had successfully used this to work with Outlook, or if there were other solutions I should try instead.

谢谢.

推荐答案

如果您真的谈论同步",那么您应该看看 Microsoft Sync Framework.http://msdn.microsoft.com/en-us/sync/default

If you really talk about "synchronization" then you should take a look at Microsoft Sync Framework. http://msdn.microsoft.com/en-us/sync/default

这个框架有助于处理与同步相关的所有事情,当两个地方的相同数据发生变化时会发生什么,等等.他们有很多提供程序",例如 Outlook 就是一个提供程序",您可以使用它在您自己的数据和 Outlook 之间同步项目.

This framework helps out with everything that relates to synchronization, what happens when same data has changed in both places, and so on. And they have lots of "providers", for example Outlook are one "provider" that you can use to synk items between your own data and outlook.

联系人同步示例(C#)

Contact Synchronization Sample (C#)

来自 msdn:
此示例展示了如何创建自定义提供程序以同步不同数据源之间的内容.在此示例中,我们将在 Microsoft Outlook、Vista 联系人和 VCard 文件之间同步联系人.此演示的一个关键方面是数据映射功能,它可以通过同步框架适当地映射不同的数据源和数据类型

From msdn:
This sample shows how custom providers can be created to synchronize content between disparate data sources. In this sample we will synchronize Contacts between Microsoft Outlook, Vista Contacts and VCard files. A key aspect of this demo is the data mapping capabilities which enables disparate data sources and data types to be mapped appropriately through the Sync Framework

http://archive.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=613

还是老方法...:
如果你只是想添加一些联系人或会议,那么旧的 office interopt 就足够了,这里有一个简单的例子,11 行代码添加一个联系人:

Or the good old way...:
If you just want to add some contact or meeting then the old office interopt is good enough, here are an quick example, 11 rows of code to add a contact:

    Dim OutlookApp As Outlook.Application = New Outlook.Application
    Dim OutlookNameSpace As Outlook.NameSpace = OutlookApp.GetNamespace("MAPI")
    OutlookNameSpace.Logon()

    Dim Contacts As Outlook.MAPIFolder = OutlookNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

    Dim newContact As Outlook.ContactItem = OutlookApp.CreateItem(Outlook.OlItemType.olContactItem)
    newContact.FullName = "Stefan Karlsson"
    newContact.Email1Address = "myemail@mail.com"
    newContact.BusinessHomePage = "www.example.com"
    newContact.Save()

    OutlookApp.Logoff()
    OutlookApp.Quit()

(您必须添加对 Microsoft.Office.Interop.Outlook 的引用并将此导入添加到您的代码中才能使示例工作)

(You have to add reference to Microsoft.Office.Interop.Outlook and add this imports to your code for the example to work)

导入 Microsoft.Office.Interop

Imports Microsoft.Office.Interop

这篇关于将 Microsoft Outlook 与我自己的数据同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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