• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 42
  • Last Modified:

Outlook Office 365 Exchange Server

I had this question after viewing Outlook exchange Office 365 - Add a Subfolder to a "non'Default Folder".

I tried this code to move a folder from my main exchange folder to a subfolder in my archive folder

    Dim objOL As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objFolder As Outlook.MAPIFolder
    Dim olParentFolder As Outlook.MAPIFolder
    Dim olMovetoFolder As Outlook.MAPIFolder

    Dim CellValue1 As String, CellValue2 As String, CellValue3 As String
    Dim MoveTo1 As String, MoveTo2 As String
    Set objOL = CreateObject("outlook.application")
    Set objNS = objOL.GetNamespace("MAPI")

    CellValue1 = "roger@eaglepromanagement.com"
    CellValue2 = "projects"
    CellValue3 = "TestFolder"
    MoveTo1 = "Online Archive - roger@eaglepromanagement.com"
    MoveTo2 = "projects"

    Set olParentFolder = objNS.Folders(CellValue1).Folders(CellValue2).Folders(CellValue3)
    Set olMovetoFolder = objNS.Folders(MoveTo1).Folders(MoveTo2)
    olParentFolder.MoveTo olMovetoFolder

It gives me an error message (see attached screenshot)
  • 2
  • 2
2 Solutions
Derek Schauland (Microsoft MVP)IT ConsultantCommented:
What permissions do you have on the source folder and the destination folder?
rogerdjrAuthor Commented:
I should have thought of that!!!!

Adjusted permissions (See Attached) and it works fine
Derek Schauland (Microsoft MVP)IT ConsultantCommented:
Glad you got things moving again
rogerdjrAuthor Commented:
I should have thought of permissions - that was the issue.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now