Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Altoona, Pennsylvania, USA
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook - Access integration (Office 2000)

    I am trying to create outlook automation that assists the creation of an appointment item. I have created a VBA form that allows two combo boxes to be used to select two values from tables in access. How can I point the combo box control source to these tables. Do I need a "bound" combo box control? What reference would contain this control? Also, I am having difficulty placing the appointment the form creates. I was hoping the Item.Start and Item.End values would be "inherited" from the current calendar "cells highlighted" by the operator before he called the macro which launches the dialog. This seemed rational as "highlighting" calendar cells and then selecting "Actions" / "New Appointment" from the menu places the appointment into the "highlighted" calendar "cells". Not so, the result seems random! Is there a value that can be read for the current selection? How?

    Below is the module code.
    Attached is the vbaProject.otm file that belongs in the "C:WinProfilesusernameApplication DataMicrosoftOutlook" folder.

    Any help is appreciated.

    Sub LogTime()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myCalendar = myNameSpace.GetDefaultFolder(olFolderCalendar)
    Set myAppointments = myCalendar.Items
    ' Determine the current user name
    UserName = myNameSpace.CurrentUser.Name
    UserLen = Len(UserName)
    LastNameLen = InStr(UserName, ",") - 1
    FirstNameLen = UserLen - LastNameLen - 4
    EmployeeLastName = Left(UserName, LastNameLen)
    EmployeeFirstName = Mid(UserName, LastNameLen + 3, FirstNameLen)
    EmployeeMI = Right(UserName, 1)
    ' Initialize the Appointment Entered variable & call Log Form
    AppointmentEntered = False
    Load frmTimeLog
    ' Display the Log Form
    frmTimeLog.Show
    ' Return from Log Form
    If AppointmentEntered Then
    'Set AppointmentSelection = myAppointments.Selection
    Set newAppointment = myOlApp.CreateItem(olAppointmentItem)
    'Optional method
    'Set newAppointment = myAppointments.Add(olAppointmentItem)
    newAppointment.Body = AppointmentData
    newAppointment.Subject = AppointmentData
    'newAppointment.Start = "10/30/01 4:30:00 PM"
    'newAppointment.End = "10/30/01 5:30:00 PM"
    'Set newAppointment = myAppointments.Add(olAppointmentItem)
    newAppointment.Save
    End If
    End Sub

  2. #2
    New Lounger
    Join Date
    Jan 2001
    Location
    Altoona, Pennsylvania, USA
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook - Access integration (Office 2000)

    I was not sure the file attachment was made, so here it is again (once?)
    Attached Files Attached Files

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook - Access integration (Office 2000)

    I think I missed something. Are you doing this from VB, Access or Outlook? The code is obviously automating Outlook, but where does the Access come in? Are the comboboxes you mentioned on an Outlook form or a VB form or what?
    Charlotte

  4. #4
    New Lounger
    Join Date
    Jan 2001
    Location
    Altoona, Pennsylvania, USA
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook - Access integration (Office 2000)

    Charlotte,

    Thanks for your response.
    The comboboxes are in a form ("frmTimeLog") within the Outlook "VBAProject.OTM" file. In essence, I am trying to automate the creation of an appointment not necessarily to make it easier, but rather to enforce the inclusion of certain information within each appointment. This information exists within certain tables in an Access database and I would like to make things easy and consistent by allowing data entry to only occur through selection from these tables. I am just not sure how to automate the loading of the table info (list) into the combobox control. Additionally, although I have been able to successfully create an appointment, I am having trouble with the location in the calendar that the appointmen occurs in. I had hoped that the appointment would be placed in the cell that was highlighted before the macro was called, but this is not the case.

    Any help would be appreciated

Posting Permissions

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