FolderPath to access a personal folder
Posted on 2002-07-10
I want to open a folder that is in a personal folder (instead of \\outlook\inbox it is \\personal folder\pacc) but cannot seem to be able to point. My main goal is to open that folder up and save each mailitem in that folder as a .txt file with the subject and the date being the file name. Do I still use Set fldFolder = nmsName.GetDefaultFolder(olFolderInbox) to access the folder?
My code is starting to look something like:
Dim myItem As Inspector
Dim objItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItem = myOlApp.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
strname = objItem.Subject
objItem.SaveAs "C:\" & strname & ".txt", olTXT
MsgBox "There is no current active Inspector."
Set myNewItem = myFolder.Items(1)
Of course this uses ActiveInspector but I want it to automatically go into the folder and perform the saveas without any mailitems opened.