Solved

send appointment C sharp

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
User Authentication using Digital Certificate 2 46
Install Problem 13 30
Printing 1 51
C# bracket error 3 30
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

770 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