Solved

send appointment C sharp

Posted on 2002-07-16
4
735 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
[X]
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
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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