Outlook Object Model Overview

Outlook Object Model Overview 

For accessing the outlook and its features you have to add reference of Microsoft Outlook 11.0 object library Version 9.2 (COM component) to your project.This COM component provides various objects through we can access the outlook.

  1. Microsoft.Office.Interop.Outlook.Application
  2. Microsoft.Office.Interop.Outlook.Explorer
  3. Microsoft.Office.Interop.Outlook.Inspector
  4. Microsoft.Office.Interop.Outlook.MAPIFolder
  5. Microsoft.Office.Interop.Outlook.MailItem
  6. Microsoft.Office.Interop.Outlook.AppointmentItem
  7. Microsoft.Office.Interop.Outlook.TaskItem
  8. Microsoft.Office.Interop.Outlook.ContactItem 

1. Microsoft.Office.Interop.Outlook.Application

 

Using this class we can create an object ot the outlook application.

 

Microsoft.Office.Interop.Outlook.Application outlookApp = newMicrosoft.Office.Interop.Outlook.Application();

 

2. Microsoft.Office.Interop.Outlook.AppointmentItem

 

You can create an appointment using this class. You can not directly create an instance of this class. Because the AppointmentItemClass has not constructors defined so; you have to use the application object for create an instance of the appointment object.  

For create an instance of the AppointmentItem object You have to use the Application object'sCreateItem() method. This method takes OlItemType enumuration parameter which has eight values.

 

(olAppointmentItem, olContactItem, olDistributionListItem, olJournalItem, olMailItem, olNoteItem, olPostItem, olTaskItem) and cast it to AppintmenItem type.

Microsoft.Office.Interop.Outlook.AppointmentItem oAppointment = (Microsoft.Office.Interop.Outlook.AppointmentItem)outlookApp.CreateItem

(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);

 

AppointmentItem object provides various properties.

 

Properties

Property

Description

Type

Subject

Set the subject of the appointment

String

Location

Location of the appointment

String

Body

Body of the appointment

String

Start

Set start date time of appointment

DateTime

End

Set end date time of appointment

DateTime

ReminderSet

Set whether reminder is on or off

Boolean

ReminderMinuteBeforeStart

Set the time period before reminder message is popup

Integer

ReminderPlaySound

Set the sound file path which play sound when reminder is active

String (Path)

Importance

Set the importance priority for appointment

OlImportance

BusyStatus

Set the status of appointment

OlBusyStatus

OlImportance enumeration takes three values

 

olImportanceHigh     ->   High importance

olImportanceLow     ->   Low importance

olImportanceNormal ->  Normal importance

 

OlBusyStatus enumeration takes four values

 

olBusy                  ->  Busy status

olFree                  ->  Free status

olOutOfOffice        ->  Out of office status

olTentative           ->  Tentative status (under terms not fully final) 

 

Methods:

 

Save()

 

This method save your appointment to your system. When you call the save() method an appointment is save to outlook.

 

ForwardAsVcal()

 

This method can be used to the Vcs file via email.

 

Microsoft.Office.Interop.Outlook.MailItem oMailItem = oAppointment.ForwardAsVcal();

oMailItem.To = "Destination mail id";

oMailItem.Send() ;

The send method send the appointment via email.

The receipient receive the mail and press the save button the appointment is automatically add to his outlook.

 

//Create an instance of the Appilcation object

Microsoft.Office.Interop.Outlook.Application outlookApp = new Application();       

 

//Create and instance of the Appointment class 

Microsoft.Office.Interop.Outlook.AppointmentItem oAppointment = (Microsoft.Office.Interop.Outlook.AppointmentItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);

 

//Set the various property of the appointmentitem object

oAppointment.Subject = "This is appointment Subject";

oAppointment.Body = "This is appointment body";

oAppointment.Location = "This is appointment location";

oAppointment.Start= Convert.ToDateTime("06/29/2006 10:00:00 AM");

oAppointment.End= Convert.ToDateTime("06/29/2006 10:00:00 AM");

oAppointment.ReminderSet = true;

oAppointment.ReminderMinutesBeforeStart = 15;

oAppointment.ReminderPlaySound = false;

oAppointment.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;

oAppointment.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;    
   

//This method save the appointment to the outlook

oAppointment.Save();

       

//send a mail and appointment as an attachment to Ajay Rohilla

Microsoft.Office.Interop.Outlook.MailItem oMailItem = oAppointment.ForwardAsVcal();

oMailItem.To = "FirstName.LastName @t-systems.com";

oMailItem.Send();

 

3. Microsoft.Office.Interop.Outlook.ContactItem

 

Using this class you can add contacts to outlook. You have to create an instance of the application object and then set the parameter value  olContactItem to OlItemType to the CreateItem() mehod of the Appication object.

 

Microsoft.Office.Interop.Outlook.Application outlookApp = new Application();

Microsoft.Office.Interop.Outlook.ContactItem newContatItem = (Microsoft.Office.Interop.Outlook.ContactItem)outlookApp.CreateItem(OlItemType.olContactItem); 

 

Properies:  

Property

Description

Type

FirstName

First name of the user

String

LastName

Last name of the user

String

Email1Address

First email address of the user

String

PrimaryTelephoneNumber

Telephone number

String

MailAddressCity

Name of the city

String

JobTitle

Job title of the user

String

Birthday

Birth date of the user

DateTime

Methods:

 

AddPicture(String): Add the picture to the contact item. Pass the string which is the path of the image fie as value to this method.

Save() : Save the contact item to the outlook.

Display(Boolean): This method takes a Boolean value in paramether. If you pass the true value it will popup the contact item window otherwise it will not display.

ForwardAsVcard(): Using this method you can send the Vcard via email.

 

Microsoft.Office.Interop.Outlook.Application outlookApp = new Application();

Microsoft.Office.Interop.Outlook.ContactItem newContatItem = (Microsoft.Office.Interop.Outlook.ContactItem)outlookApp.CreateItem(OlItemType.olContactItem);

newContatItem.FirstName = "FistName";

newContatItem.LastName = "LastName";

newContatItem.Email1Address = "LastName.FirstName@MySite.com";       newContatItem.PrimaryTelephoneNumber = "98********";

newContatItem.MailingAddressCity = "Pune";

newContatItem.MailingAddressState = "Maharashtra";

newContatItem.JobTitle = "Consultant";

newContatItem.CompanyName = "T-Systems India Pvt. Ltd";

newContatItem.BusinessFaxNumber = "022******";

newContatItem.BusinessTelephoneNumber = "020******";

newContatItem.MobileTelephoneNumber = "098********";

newContatItem.BusinessAddress = @"7th Floor,S B Road";

newContatItem.Department = "B Solution";

newContatItem.OfficeLocation = "Office Location";

newContatItem.Profession = "Software Development";

newContatItem.ManagerName = "ManagerName";

newContatItem.AssistantName = "Assistant's Name";

newContatItem.NickName = "Nick Name";

newContatItem.Spouse = "Spouse Name";

newContatItem.Birthday = Convert.ToDateTime("mm/dd/yyyy");

string imagePath = @"path…… \Sree Sai2.bmp";

newContatItem.AddPicture(imagePath);

newContatItem.Save();

newContatItem.Display(true);

Microsoft.Office.Interop.Outlook.MailItem oMailItem = newContatItem.ForwardAsVcard();

oMailItem.To = "Ajay.Rohilla@t-systems.com";

oMailItem.Send();

 

4. Microsoft.Office.Interop.Outlook.TaskItem

 

Using this class you can add tasks to outlook. You have to create an instance of the application object and then set the parameter value  olTaskItem to OlItemType to the CreateItem() mehod of the Appication object.

 

Microsoft.Office.Interop.Outlook.Application outlookApp = new Application();

Microsoft.Office.Interop.Outlook.TaskItem oTask = (Microsoft.Office.Interop.Outlook.TaskItem)outlookApp.CreateItem(OlItemType.olTaskItem);

 

Properties

Property

Description

Type

Subject

Subject of the task

String

DueDate

Due date of the task

DateTime

StartDate

Start date of the task

DateTime

ReminderSet

Whether reminder is on or off

Boolean

ReminderTime

Time of the reminder

DateTime

Body

Body of the task

String

Status

Status of the task

OlTaskStatus

OlTaskStatus enumeration contains five values

 

olTaskComplete        -> Task is complete

olTaskDeferred         -> Task is deferred

olTaskInProgress      -> Task is in progress (Continue)

olTaskNotStarted     -> Task is not started

olTaskWaiting          -> Task is in wait

 

Methods:
 

Save(): This method saves the task to the outlook.

 

Send the task via email:

 

If you want to send the task then you have to create an instance of the Receipient class.

Microsoft.Office.Interop.Outlook.Recipients oRecipients = oTask.Recipients;

 

//Code of the task
Microsoft.Office.Interop.Outlook.Application outlookApp = new Application();

Microsoft.Office.Interop.Outlook.TaskItem oTask = (Microsoft.Office.Interop.Outlook.TaskItem)outlookApp.CreateItem(OlItemType.olTaskItem);

oTask.Subject = "This is my task subject";

oTask.DueDate = Convert.ToDateTime("06/29/2006");

oTask.StartDate = Convert.ToDateTime("06/28/2006");

oTask.ReminderSet = true;

oTask.ReminderTime = Convert.ToDateTime("06/28/2006 02:40:00 PM");

oTask.Body = "This is the task body";

oTask.SchedulePlusPriority = "High";

oTask.Status = OlTaskStatus.olTaskInProgress;

oTask.Save();

 

//Send task via email
Microsoft.Office.Interop.Outlook.Recipients oRecipients = oTask.Recipients;

Microsoft.Office.Interop.Outlook.Recipient oReceipient;

oReceipient = oRecipients.Add("FirstName1.LastName@Server.com");

oReceipient = oRecipients.Add("FirstName2. LastName@Server.com");

oReceipient = oRecipients.Add("FirstName3. LastName@Server.com");

oReceipient.Type = 1;

oRecipients.ResolveAll();

oTask.Assign();

oTask.Send();

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值