Synchronize Outlook pst-Files with C#
How can I connect to a .pst-File?
I've only found the way to connect over the MAPI Namespace on the active .pst-File.
Which ist the way to synch two .pst-Files.
Thank you very much for your answers.
Joker
namespace Outlookproject
{
public class OutlookConnect
{
private Outlook.Application _myApp;
private Outlook._NameSpace _myNameSpace;
private Outlook.MAPIFolder _myContactFolder;
public OutlookConnect()
{
_myApp = new Outlook.Application();
_myNameSpace= _myApp.GetNamespace("MAPI");
_myNameSpace.Logon(null,null,true,true);
_myContactFolder = _myNameSpace.GetDefaultFold
(Outlook.OlDefaultFolders.olFolderContacts);
}
public String GetContactName()
{
return ((Outlook._ContactItem)_myContactFolder.Items.Item(5)).FullName;
}
}
public class MainClass
{
[STAThread]
static void Main()
{
OutlookConnect connect = new OutlookConnect();
Console.WriteLine(connect.GetContactName());
}
}
}