Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Interop / September 2004

Tip: Looking for answers? Try searching our database.

opening a pst file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
noemailformefromyou@yahoo.com - 03 Sep 2004 07:32 GMT
I am trying to open a private pst file via C#.NET.  I can't seem to
find the right answer.  I thought that the following code segment
would do it, but it doesn't seem to matter what dir path I put in,
nothing works.

Outlook.Application app = new Outlook.ApplicationClass();
Outlook.NameSpace ns =app.GetNamespace("MAPI");
ns.Logon ("c:\\test.pst", "", false, true);

Now after this I am trying to access the Tasks folder within that pst
file, so maybe this is an issue.  I just don't know anymore


Outlook.MAPIFolder tskFld=ns.GetDefaultFolder
Outlook.OlDefaultFolders.olFolderTasks);

Any hints, samples or whatever would be greatly appreciated.  I found
lots of people on the net asking the same question, but I've never
seen an answer.
T OPry - 03 Sep 2004 20:38 GMT
I believe the NS.Logon method expects the Profile name as the first param.
When I open PST's, I have always had to use something like the following:

Dim oOutlook As New Microsoft.Office.Interop.Outlook.Application

Dim oNameSpace As Outlook.NameSpace

Dim pst As Outlook.MAPIFolder

Dim sFolderName As String = "Aug2004-03"

Dim sPstName As String = "\\ServerName\PSTFiles\MailArchive\" & sFolderName
& ".pst"

oOutlook.Session.Logon("Archive", "pass", True, True)

oNameSpace = oOutlook.Session()

oNameSpace.AddStore(sPstName)

> I am trying to open a private pst file via C#.NET.  I can't seem to
> find the right answer.  I thought that the following code segment
[quoted text clipped - 14 lines]
> lots of people on the net asking the same question, but I've never
> seen an answer.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.