Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to create an Outlook Calendar folder on a computer that is running Exchange 2000 Server by using Visual C#

View products that this article applies to.

This article was previously published under Q310279

↑ Back to the top


This article describes how to use Microsoft XML 3.0 to create a Microsoft Outlook Calendar folder on a computer that is running Microsoft Exchange 2000 Server by using Microsoft Visual C# .

↑ Back to the top

More information

To use Microsoft XML 3.0 to create an Outlook Calendar folder, follow these steps:
  1. Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005.
  2. On the File menu, point to New, and then click Project.
  3. In the Visual C# Projects types list, click Console Application.

    In Visual Studio .NET, Class1.cs is created by default. In Visual Studio 2005, Program.cs is created by default.

    Note In Visual Studio 2005, click Visual C#, and then click Console Application.
  4. Add a reference to Microsoft XML 3.0. To do so, follow these steps:
    1. On the Project menu, click Add Reference.
    2. Click the COM tab, locate Microsoft XML v3.0, and then click Select.

      Note In Visual Studio 2005, you do not have to click Select.
    3. In the Add References dialog box, click OK.
    4. If you are prompted to generate wrappers for the libraries that you selected, click Yes.
  5. In the code window, replace the code with the following:
    using System;
    namespace WebDav
    	class Class1
    		public static void Main(String [] args)
    			MSXML2.XMLHTTP30 oXMLHttp = new MSXML2.XMLHTTP30();
                            // TODO: Replace with your new folder URL
    			String sUrl = "http://ExchServer/public/MyApplication/NewFolder";
    			// TODO: Replace the account and password	"MKCOL", sUrl, false, @"UserDomain\UserAlias", "UserPassword"); 
    			String sQuery;
    			sQuery = "<?xml version='1.0'?>" + 
    				"<a:propertyupdate xmlns:a='DAV:' " + 
    				"xmlns:ex=''>" + 
    				"<a:set><a:prop>" + 
    				"<ex:outlookfolderclass>IPF.Appointment</ex:outlookfolderclass>" + 
    				"</a:prop></a:set>" + 
    			oXMLHttp.setRequestHeader("Content-Type", "text/xml");				
    			catch (Exception e)
    				Console.WriteLine("{0} Exception caught.", e);
  6. Search for TODO in the code, and then modify the code for your environment.
  7. Press F5 to build and to run the program.
  8. Make sure that the folder was created.

↑ Back to the top

Keywords: KB310279, kbhowtomaster, kbxml, kbcode, kbmsg

↑ Back to the top

Article Info
Article ID : 310279
Revision : 7
Created on : 12/11/2006
Published on : 12/11/2006
Exists online : False
Views : 373