reccuring apointment
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
reccuring apointment

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
genius33
Guest





Posted: Tue Aug 30, 2005 12:59 am    Post subject: reccuring apointment Reply with quote

ok it's work with it :
ObjPer, ObjAppt, ObjMbx is in reference of "myname@mydomain.com"
work great.
but to make it work i am obliged to put "myname@mydomain.com" in
strAttnMandatory and strAttnOptional.

please help me :-(

// Reference to Microsoft ActiveX Data Objects 2.5 Library
// Reference to Microsoft CDO for Exchange 2000 Library
static void CreateRecurringMeeting (CDO.Person ObjPer,
CDO.Appointment ObjAppt,
CDO.CdoFrequency ObjFreq,
long LngInterval,
DateTime dtmEndDate,
CDO.IMailbox ObjMbx,
string[] strAttnMandatory,
string[] strAttnOptional)
{
try
{
// Variables.
CDO.Configuration ObjConfig = new CDO.Configuration();
CDO.IRecurrencePattern ObjRRule;
CDO.CalendarMessage ObjCalMsg;
CDO.Attendee ObjAtten = new CDO.Attendee();
ADODB.Connection ObjConn = new ADODB.Connection();

ObjConn.Provider = "ExOLEDB.DataSource";

// Set the configuration fields.
ObjConfig.Fields[CDO.CdoConfiguration.cdoSendEmailAddress].Value =
ObjPer.Email;
ObjConfig.Fields[CDO.CdoConfiguration.cdoMailboxURL].Value =
ObjMbx.BaseFolder;
ObjConfig.Fields.Update();

ObjAppt.Configuration = ObjConfig;

// Create the RecurrencePattern object.
ObjRRule = ObjAppt.RecurrencePatterns.Add("Add");

// Set the recurrence pattern frequency,
// such as cdoWeekly or cdoDaily.
ObjRRule.Frequency = ObjFreq;

// Set the recurrence pattern interval,
// such as "2".
ObjRRule.Interval = (int)LngInterval;

// Set the recurrence pattern end date.
ObjRRule.PatternEndDate = dtmEndDate;

// Add mandatory attendees.
long i;
for (i = 0; i < strAttnMandatory.Length; ++i)
{
ObjAtten = ObjAppt.Attendees.Add("");
ObjAtten.Address = Convert.ToString(strAttnMandatory[i]);
ObjAtten.Role = CDO.CdoAttendeeRoleValues.cdoRequiredParticipant;
}

// Add optional attendees.
for (i = 0; i < strAttnOptional.Length; ++i)
{
ObjAtten = ObjAppt.Attendees.Add("");
ObjAtten.Address = Convert.ToString(strAttnOptional[i]);
ObjAtten.Role = CDO.CdoAttendeeRoleValues.cdoOptionalParticipant;
}

// Create the meeting request message.
ObjCalMsg = ObjAppt.CreateRequest();

// Save the appointment to the organizer's calendar.
ObjConn.Open(ObjMbx.BaseFolder, "", "", -1);

ObjAppt.DataSource.SaveToContainer(ObjMbx.Calendar, ObjConn,
ADODB.ConnectModeEnum.adModeReadWrite,
ADODB.RecordCreateOptionsEnum.adCreateNonCollection,
ADODB.RecordOpenOptionsEnum.adOpenSource, "", "");

// Send the meeting request message to the attendees.
ObjCalMsg.Message.Send();

// Close the connection.
ObjConn.Close();

Console.WriteLine("Meeting sent.");
}

catch (Exception err)
{
Console.WriteLine(err.ToString());
}
}

Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB