![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
The code sample at http://www.outlookcode.com/codedetail.aspx?id=962 shows how to add a .pst file and set its display name.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Carol Chisholm" wrote in message ... I'm building a set of quarterly archive folders. I create new stored then rename them. Since they are created without inboxes, I then have to add an inbox. However I can't find my newly renamed .pst file until the executing code is stopped and restarted. Any ideas: does AddStore accept a name argument? Or how can I refresh the folderlist in the current namespace? .... for i = 1 to n olSession.AddStore sArchPath & sArchFold(i) If olSession.Folders.GetLast.Name = "Personal Folders" Then olSession.Folders.GetLast.Name = sArchFold(i) End If 'look for inbox, if it don't exist, create strTempFolderRoot = sArchFold(i) strTempFolder = sArchFold(i) & "\Inbox" Set olTempFolderRoot = GetFolder(strTempFolderRoot) Set olTempFolder = GetFolder(strTempFolder) If olTempFolder Is Nothing Then olTempFolderRoot.Folders.Add ("Inbox") End If .... Function GetFolder(strFolderPath As String) As Outlook.MAPIFolder Dim colFolders As Outlook.Folders Dim objFolder As Outlook.MAPIFolder Dim arrFolders() As String Dim i As Long On Error Resume Next strFolderPath = Replace(strFolderPath, "/", "\") arrFolders() = Split(strFolderPath, "\") Set objFolder = olSession.Folders.Item(arrFolders(0)) If Not objFolder Is Nothing Then For i = 1 To UBound(arrFolders) Set colFolders = objFolder.Folders Set objFolder = Nothing Set objFolder = colFolders.Item(arrFolders(i)) If objFolder Is Nothing Then Exit For End If Next End If Set GetFolder = objFolder Set colFolders = Nothing End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can not point outlook to read pst file from a backup file | Jaime | Outlook - Installation | 1 | May 19th 06 09:42 PM |
Trouble opening an Outlook .pst file; not recognizing as .pst! | MN Rhino | Outlook - Installation | 6 | May 9th 06 12:59 AM |
pst file option missing under new outlook data file dialog | UncleBuckle | Outlook - Installation | 2 | February 24th 06 11:49 PM |
backing up a .pst file - another process has locked a portion of the file? | [email protected] | Outlook - General Queries | 1 | February 19th 06 03:44 AM |
getting error: this .pst file is not a valid personal folder file | jen98 | Outlook - Installation | 1 | February 1st 06 11:37 PM |