-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: ksnaveen
Message 3 in Discussion
Hi... You have to use Outlook library & CDO to access various oulook folders and
messages residing inside that on your disk using various objects available with these
libraries Lot of pointers using VB & VBA is here www.slipstick.com Here is the
code for adding a message as appointment into the Outlook... I used : Outlook
Object library 2003, CDO 1.21, C#, .Net Ver 1.0 Hope this helps to kick start
Cheers!!!!
Nave private void AddAppointment()
{
int ArrayTotal=0,intPos=0;
MAPI.Session objsession=new MAPI.SessionClass();
objsession.Logon("Test_world","1",Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value);
MAPI.Folder ofolder;
MAPI.Messages omessages;
MAPI.AppointmentItem oappointment;
MAPI.Fields ofields;
ofolder=(MAPI.Folder)objsession.GetDefaultFolder(MAPI.CdoDefaultFolderTypes.CdoDefaultFolderCalendar);
omessages=(MAPI.Messages)ofolder.Messages;
oappointment=(MAPI.AppointmentItem)omessages.Add(Missing.Value,Missing.Value,Missing.Value,Missing.Value
);
oappointment.MeetingStatus = MAPI.CdoMeetingStatusTypes.CdoMeeting;
oappointment.Importance = MAPI.CdoImportance.CdoHigh; oappointment.Subject
="from C#";
oappointment.Text = "testing from C#"; oappointment.StartTime =
"1/20/2004";//DateTime.Now.Date.ToString();
oappointment.EndTime = "1/20/2004"; //DateTime.Now.Date.ToString();
//ofields=(MAPI.Fields)oappointment.Fields;
//ofields.Add("Csharp",,Missing.Value,Missing.Value);
ArrayTotal=ArrayCustField.Count-1;
for(intPos=0;intPos<=ArrayTotal;intPos++)
{
string ReturnVal="";
string sCustFldName=""; ReturnVal=Fn_GetControlData(intPos);
MessageBox.Show(ArrayCustField[intPos].ToString() + " " + ReturnVal.ToString());
ofields=(MAPI.Fields)oappointment.Fields;
sCustFldName=ArrayCustField[intPos].ToString();
ofields.Add(sCustFldName,MAPI.CdoFieldType.CdoString ,ReturnVal,Missing.Value);
}
oappointment.Update(true,Missing.Value) ;
objsession.Logoff();
MessageBox.Show("Added");
}
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]