Tag Archives: outlook programming

Create an appointment in outlook using vb 6

 
This article demonstrates how to create an appointment in outlook programmatically using visual basic 6.0 through Microsoft Outlook’s object-model.

This example requires a button control in Standard EXE project in visual basic 6.0, you need an early-bound reference to a Microsoft Outlook type library. Double-click the button, and then add the following code:

Dim oApp As Outlook.Application
Set oApp = CreateObject("Outlook.Application")
 
Dim oNs As Outlook.NameSpace
Set oNs = olApp.GetNamespace("MAPI")
oNs.Logon
Dim oAppt As Outlook.AppointmentItem
Set oAppt = oApp.CreateItem(olAppointmentItem)
 oAppt.Start = "12/2/2011 2:20:00 PM"
With oAppt
      .Duration = 60
      .Subject = "meeting with Client"
      .Body = "About Project..."
      .Location = "Our New York Office"
      .ReminderSet = True
End With
oAppt.Save
Set oNs = Nothing
Set oAppt = Nothing
Set oApp = Nothing

Example to create an e-mail message in Outlook.

 
This example shows how to create an e-mail message in Outlook.

Private Sub CreateMailItem()
      Dim objItem As Outlook.MailItem = _
            Me.CreateItem(Outlook.OlItemType.olMailItem)
      objItem.Subject = "Hello Author"
      objItem.To = "aboutus@authorcode.com"
      objItem.Body = "Hello Author, i want to contact you"
      objItem.Importance = Outlook.OlImportance.olImportanceLow
      objItem.Display(False)
End Sub

How to create Outlook email item using C# and vb.net

The following code example demonstrates how to create a new Outlook e-mail item with the specified information such as To, subject or body.
In this example we will create a new Outlook email item and display. The following code sample requires a reference of ‘Microsoft.Office.Interop.Outlook’ library in your project. Continue reading How to create Outlook email item using C# and vb.net

How to read To,Cc,Bcc fields from current mailitem in vsto 2010

 
If you want to get all members of to,cc, bcc fields from the current outlook compose mail item,then we can use Application.ActiveInspector().CurrentItem object in vsto add-ins.

you can try following code snippt for reading all Recipients information with address, name and we can also get  to,cc, bcc fields from the current compose mail item.

Private Sub GetInfo()
    Dim strTo As String = ""
    Dim strCC As String = ""
    Dim strBCC As String = ""
 
    Dim _item As Outlook.MailItem = Globals.ThisAddIn.Application.ActiveInspector().CurrentItem
    strTo = _item.To
    strCC = _item.CC
    strBCC = _item.BCC
    For Each Rec As Outlook.Recipient In _item.Recipients
        MessageBox.Show("Recipient name : " & Rec.Name)
     Next
 End Sub

How to open Outlook contact window in vb.net and C#

How to open Outlook contact window in .net

If you want to add new contact information in outlook form vb.net application through outlook contact window, then you can use this code sample.
you need to add a reference to the Microsoft Outlook Object Library.

Continue reading How to open Outlook contact window in vb.net and C#