anotherview
Programmer
This VBA code for Outlook 2003 works:
It moves the selected message (or item) to the psttest folder which is in the inbox folder of the server exchange mailbox folder.
However, I want to move it to a folder in a pst file. I have tried and tried and can't figure out how to designate a folder outside of the server exchange mailbox folder as the target folder.
I have a lot of Excel VBA experience, but not much in Outlook.
Thank you in advance.
Code:
Sub movetoanotherfolder()
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myInbox = myNamespace.GetDefaultFolder(olFolderInbox)
For Each currentMessage In myOlApp.ActiveExplorer.Selection
currentMessage.Move (myInbox.Folders("psttest"))
Next
End Sub
It moves the selected message (or item) to the psttest folder which is in the inbox folder of the server exchange mailbox folder.
However, I want to move it to a folder in a pst file. I have tried and tried and can't figure out how to designate a folder outside of the server exchange mailbox folder as the target folder.
I have a lot of Excel VBA experience, but not much in Outlook.
Thank you in advance.