A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Closing a PST file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 6th 06, 09:14 AM posted to microsoft.public.outlook.program_vba
Mark Rae
external usenet poster
 
Posts: 6
Default Closing a PST file

Hi,

I'm using the code I found he
http://www.outlookcode.com/codedetail.aspx?id=962 to open a local PST file -
works great.

However, once I'm finished working with the PST file, I want to close it
again so that it no longer appears in Outlook.

I've tried modifying the code above as follows:

Dim mobjOL As Outlook.Application
Dim mobjNS As Outlook.NameSpace
Dim mobjFolder As Outlook.MAPIFolder

Sub TestSetNewStore2()
Dim newStore As Outlook.MAPIFolder
On Error Resume Next

Set newStore = SetNewStore2("C:\MyNewStore.pst", "My New Store Folders")

' unfinished - folder processing goes here...

mobjNS.RemoveStore newStore ' new line to try to close the newStore
folders
Set newStore = Nothing
End Sub

This doesn't cause any runtime errors, but doesn't actually close the PST
file.

I'm obviously missing something fairly fundamental...

Any assistance gratefully received.

Mark


Ads
  #2  
Old May 6th 06, 09:48 AM posted to microsoft.public.outlook.program_vba
Mark Rae
external usenet poster
 
Posts: 6
Default Closing a PST file

"Mark Rae" wrote in message
...

I'm obviously missing something fairly fundamental...


Yeah, like a missing comma...!

Apologies for the waste of bandwidth... :-(


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"not a personal folders file (.pst)" opening backup Outlook.pst JimmyZ Outlook - Installation 10 July 28th 06 05:32 PM
pst file option missing under new outlook data file dialog UncleBuckle Outlook - Installation 2 February 25th 06 12:49 AM
What's the right way to import a PST file? Michael Levin Outlook - General Queries 8 February 21st 06 03:04 PM
backing up a .pst file - another process has locked a portion of the file? [email protected] Outlook - General Queries 1 February 19th 06 04:44 AM
getting error: this .pst file is not a valid personal folder file jen98 Outlook - Installation 1 February 2nd 06 12:37 AM


All times are GMT +1. The time now is 07:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.