The following steps will help us to create the application.
- Start Microsoft Visual Studio .NET.
- On the File menu, click New, and then click Project.
- Click Visual Basic Projects under Project Types, and then click Console Application under Templates. By default, Module1.vb is created.
- Add a reference to the Microsoft Outlook 10.0/11.0 Object Library. To do this, follow these steps:
- On the Project menu, click Add Reference.
- On the COM tab, click Microsoft Outlook 10.0 Object Library, and then click Select.
- Click OK in the Add References dialog box to accept your selections. If you are prompted to generate wrappers for the library that you selected, click Yes.
5. In the Code window, replace all of the code with the following:
Imports System.Reflection
Module Module1
Sub
Try
' Create an Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application()
' Get NameSpace and Logon.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi") oNS.Logon("Outlook", Missing.Value, False, True)
' TODO: ' Create a new TaskItem.
Dim OTask As Outlook.TaskItem = App.CreateItem(Outlook.OlItemType.olTaskItem)
' Assign the task
OTask.Assign()
' Add recipients to the task
Join the conversation! Your thoughts help the community grow.