Results 1 to 2 of 2

Thread: Creating an Appiontment in Outlook from VB?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    9

    Talking


    Is there away of creating an appiontment in Outlook, from VB6, without having to run up Outlook!? I've tried running up outlook without .display and then create an appiontment....but it doesny work!!

    Can anybody help!!?


    Thanks


    Archi!

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    No, you can't. Yes I can. I manipulate calendars, task lists, and E-mail in outlook all of the time without showing the user Outlook.


    Private Sub Form_Load()

    Dim OLApp As Outlook.Application
    Dim OLNameSpace As Outlook.NameSpace
    Dim OLRecipient As Outlook.Recipient
    Dim OLAppt As Outlook.AppointmentItem

    Set OLApp = New Outlook.Application
    Set OLNameSpace = OLApp.GetNamespace("MAPI")
    olNameSpace.Logoff
    olNameSpace.Logon "Logon Name", "Password", False, True

    Set OLRecipient = OLNameSpace.CreateRecipient("Recipient Name")
    Set OLAppt = OLNameSpace.GetSharedDefaultFolder(OLRecipient, olFolderCalendar).Items.Add
    OLAppt.Location = "Location"
    OLAppt.Subject = "Subject"
    OLAppt.Body = "Testing for calendar add"
    OLAppt.Start = CDate("12/31/00 01:00 AM")
    OLAppt.End = CDate("12/31/00 01:01 AM")
    OLAppt.Save

    Set OLAppt = Nothing
    OLNameSpace.Logoff
    Set OLApp = Nothing
    Set OLNameSpace = Nothing
    Set OLRecipient = Nothing

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width