Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2004, 09:48 AM
Registered User
 
Join Date: May 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!Help!Help!

I'm trying to send an appointment from an object I'm working on.
I know about this CDO class but I have no idea about this thig called
"CDO.IMailBox" and what should I do with that.
Does someone ever used and did such a thing and have some samples?

I need it urgent in C# not VB.NET not VB only C#.
A sample and explenation will help.

 
Old July 14th, 2004, 05:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Could you post any relevant code? It's hard to tell what your problem is without seing it.

Thanks,

Brian
 
Old July 15th, 2004, 02:52 AM
Registered User
 
Join Date: May 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the code:
Thanks!

------------------------------------------------------------------

using System;

namespace Samples
{
    class Class1
    {
        static void Main(string[] args)
        {
            try
            {
            CDO.Appointment oApp = new CDO.Appointment();

                        // TODO:
            string sURL = "http://ExchServer/Exchange/UserAlias/calendar";

            ADODB.Connection oCn = new ADODB.Connection();
            oCn.Provider = "exoledb.datasource";

            oCn.Open(sURL, "", "", 0);

            CDO.Configuration iConfg = new CDO.Configuration();
            ADODB.Fields oFields;


            oFields = iConfg.Fields;
            oFields[CDO.CdoCalendar.cdoTimeZoneIDURN].Value = CDO.CdoTimeZoneId.cdoPacific;

            // Set Meeting Organizer
            oFields[CDO.CdoConfiguration.cdoSendEmailAddress].Value = "[email protected]";
            oFields.Update();

            oApp.Configuration = iConfg;
            oApp.StartTime = Convert.ToDateTime("10/11/2001 10:00:00 AM");
            oApp.EndTime = Convert.ToDateTime("10/11/2001 11:00:00 AM");
            oApp.Location = "My Cube";
            oApp.Subject = "Test: Create Meeting in C#";
            oApp.TextBody = "Hello...";

            // Add Recurring
            // Every Thursday starting Today and run 3 times
            CDO.IRecurrencePatterns iRPatters = oApp.RecurrencePatterns;
            CDO.IRecurrencePattern iRPatter = iRPatters.Add("Add");
            iRPatter.Frequency = CDO.CdoFrequency.cdoWeekly;
            iRPatter.Interval = 1; // 1 hour from 10 to 11
            iRPatter.DaysOfWeek.Add(4); // every Thursday
            iRPatter.Instances = 3;

            // Add Attendees
            CDO.IAttendees iAtdees = oApp.Attendees;
            CDO.IAttendee iAtdee = iAtdees.Add("[email protected]"); // TODO:

            CDO.ICalendarMessage iCalMsg = (CDO.ICalendarMessage)oApp.CreateRequest();
            iCalMsg.Message.Send();


            // Save to the Events Calendar
            oApp.DataSource.SaveToContainer(sURL, null,
                ADODB.ConnectModeEnum.adModeReadWrite,
                ADODB.RecordCreateOptionsEnum.adCreateNonCollectio n,
                ADODB.RecordOpenOptionsEnum.adOpenSource,
                "", "");

            oCn.Close();

            oApp = null;
            oCn = null;
            oFields = null;
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
            }
        }
        }
}










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.