Solved

send appointment C sharp

Posted on 2002-07-16
4
728 Views
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?

Thanks!
0
Comment
Question by:hugotorres32
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrMicrosoftOutlook2000.asp
0
 
LVL 10

Accepted Solution

by:
Chad Smith earned 20 total points
Comment Utility
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.

0
 
LVL 10

Expert Comment

by:Chad Smith
Comment Utility
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);
               objExplorer.Activate();

               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;
               objMail.Save();
          }
     }
}
0
 
LVL 20

Expert Comment

by:TheAvenger
Comment Utility
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheAvenger
EE Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now