send appointment C sharp

Posted on 2002-07-16
Last Modified: 2011-04-14
hi friens,

i need to create a program (C#.NET) where i send an appointment through outlook.  
Is there anyone having some sample code?

Question by:hugotorres32
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 7165421
you may not find too many smaple in c# - your best bet would be to look for samples written on VB (or C++) and convert them

the MSDN at MS is a good place to start
LVL 10

Accepted Solution

Chad Smith earned 20 total points
ID: 7224800
I have some example code for c# to do what you need and more with Outlook.  If you provide your email address, I will send it to you.

LVL 10

Expert Comment

by:Chad Smith
ID: 7224883
Here is the one to mail an appointment, if you want other examples let me know.

// Must run the folling command to create wrapper for outlook/office
// tlbimp "c:\program files\microsoft office\office\msoutl9.olb"

using System;
using msoutl9;

namespace OutlookEmail
     /// <summary>
     /// Summary description for Class1.
     /// </summary>
     class Email
          public static msoutl9.Application objOutlook = new msoutl9.ApplicationClass();
          public static msoutl9.Folders objFolders = objOutlook.GetNamespace("MAPI").Folders;
          public static msoutl9.NameSpace objFolder = objOutlook.GetNamespace("MAPI");
          static void Main(string[] args)

               msoutl9.Application objOutlook = new msoutl9.ApplicationClass();
               msoutl9.NameSpace objFolder = objOutlook.GetNamespace("MAPI");
               msoutl9.Explorer objExplorer = objOutlook.Explorers.Add(objFolder.GetDefaultFolder(OlDefaultFolders.olFolderDrafts), OlFolderDisplayMode.olFolderDisplayNormal);

               msoutl9.AppointmentItem objAppointment = (msoutl9.AppointmentItem) objOutlook.CreateItem(OlItemType.olAppointmentItem);
               DateTime dtNow = DateTime.Now;
               objAppointment.Start = dtNow;
               objAppointment.End = dtNow.AddDays(3).AddMinutes(15);
               objAppointment.Body = "Appointment Message";
               objAppointment.ReminderMinutesBeforeStart = 15;

               msoutl9.MailItem objMail = objAppointment.ForwardAsVcal();
               objMail.To = "user@localhost";
               objMail.Subject = "Important Appointment";
               objMail.Body = "Hi,\nHere is a new appointment for you.";
               objMail.Importance = msoutl9.OlImportance.olImportanceHigh;
LVL 20

Expert Comment

ID: 9485203
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept a comment by knight00
Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question