Copy public Folder to Local Folder with VBA

  • Thread starter Thread starter Frank Connemann
  • Start date Start date
F

Frank Connemann

Hello NG

How can i copy with a VBA Skript a Public Task Folder (echange) to der
Privat Mailbox (Exchange)
Please post me a Code-Sample.

thx
Frank Connemann
 
Make the source public folder the active one and run this macro to copy it
under the Inbox folder in the default Mailbox:

Sub CopyFolder()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myInboxFolder As Outlook.MAPIFolder
Dim myCurrentFolder As Outlook.MAPIFolder
Dim myNewFolder As Outlook.MAPIFolder

Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myInboxFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myCurrentFolder = myOlApp.ActiveExplorer.CurrentFolder
Set myNewFolder = myCurrentFolder.CopyTo(myInboxFolder)
End Sub
 
Back
Top