Solved

send appointment C sharp

Posted on 2002-07-16
4
733 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
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

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
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.

0
 
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);
               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
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheAvenger
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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