Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:30:25+00:00 2026-06-15T09:30:25+00:00

I am working on a client that access an Exchange Web Service via a

  • 0

I am working on a client that access an Exchange Web Service via a web reference. (not the Managed API). This is the first time I’m worked with EWS so I hope its just a simple mistake that I overlooked.

I have a method called MoveItem that is supposed to take email message and move it from the Inbox to destinationFolder. When I run this code, the item does disappear from the Inbox however it never shows up in the destination folder. I’ve spent a couple of days looking at examples online and I’ve also not been able to find anyone else that has had a similar issue. Can anyone tell me what I am doing wrong? Thanks in advance

Scott

static void MoveItem(ExchangeServiceBinding esb, BaseFolderType destinationFolder, MessageType msg)
{
ItemIdType[] items = new ItemIdType[1] { (ItemIdType)msg.ItemId };
BaseFolderIdType destFolder = destinationFolder.FolderId;
MoveItemType request = new MoveItemType();
request.ItemIds = items;
request.ToFolderId = new TargetFolderIdType();
request.ToFolderId.Item = destFolder;

try
{
     MoveItemResponseType response = esb.MoveItem(request);
     ArrayOfResponseMessagesType aormt = response.ResponseMessages;
     ResponseMessageType[] rmta = aormt.Items;

    foreach (ResponseMessageType rmt in rmta)
    {
        if (rmt.ResponseClass == ResponseClassType.Error)
        {
              throw new Exception("Item move failed.");
        }
    }
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:30:26+00:00Added an answer on June 15, 2026 at 9:30 am

    Definitely not an expert here, but this is the following code I used to grab an item and move it into a folder:

            Folder rootfolder = Folder.Bind(service, WellKnownFolderName.MsgFolderRoot);
            rootfolder.Load();
    
            foreach (Folder folder in rootfolder.FindFolders(new FolderView(100)))
            {
                // Finds the emails in a certain folder, in this case the Junk Email
                FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.JunkEmail, new ItemView(10));
    
                // Enter your destination folder name below this:
                if (folder.DisplayName == "Example")
                {
                    // Stores the Folder ID in a variable
                    var fid = folder.Id;
                    Console.WriteLine(fid);
                    foreach (Item item in findResults.Items)
                    {
                        // Load the email, move it to the specified folder
                        item.Load();
                        item.Move(fid);
                    }
    
                }
            }
    

    One thing about the EWS is that when moving to a folder, the ID of the folder is key. In this example, I first find the folders in the inbox, then access the messages. Therefore, any code regarding the individual message would go after the folders have been found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started working with a client that had an index.html file with this
I've been working in client-service applications all my life so now that I can
A client im working for has created a web app that uses a password
Acknowledging that the authenticated referral mechanism is currently not working with the mobile web
I have a client app that can upload some data via a WCF service.
I'm working on a client-server application (.NET 4, WCF) that must support backwards compatibility.
I'm working on an iPhone app that requires a basic client/server interaction model. For
I am working with an application that is used by multiple clients. Each client
I'm currently working on a project that has a sizable amount of both client
I'm writing an identi.ca client, and seems that @reply isn't working. After investigation I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.