Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Send Meeting Request Code - Access 2010 and Outlook 2010

Posted on 2011-02-11
1
Medium Priority
?
900 Views
Last Modified: 2012-05-11
I have an Access Database setup like so...

I have a table called t_users  The fields are..

Field 1 - Employee
Field 2 - Email Address

I have a table called t_rooms. The field is ..

Field 1 - Meeting Room

I have a form called f_users and it consists of a drop down box, field name Employee and I choose a name from the table t_users. I also have a drop down box, field name Room and I choose a Room from the t_rooms table.


I need a script/module....

I want to press a form button and create a meeting request to this chosen employee and I want the chosen Room as the Subject.  I also need to manipulate the date/time of the meeting request before being sent either using date fields on the form or another method.

Thanks!
0
Comment
Question by:preshomes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
omgang earned 2000 total points
ID: 34891328
I wrote this as a public function.  You can modify for use directly on your form or you can add input parameters to pass in for your purposes.
You'll need to handle how you want to populate the other properties for the meeting, e.g. location, body, etc.
If you want to use form fields to pass the meeting start and end date/time values then replace the user prompts with value assignments from your form field.

OM Gang



Public Function SendOutlookApptReminder()
On Error GoTo Err_SendOutlookApptReminder

    Dim olOutlook As New Outlook.Application
    Dim olCalendarItem As Outlook.AppointmentItem
    Dim olMailItem As Outlook.MailItem
    Dim olRecipient As Outlook.Recipient
    Dim dteStart As Date, dteEnd As Date, dteDefault As Date
   
        'default meeting date/time is today at noon
    dteDefault = Date & " 12:00:00 PM"
   
        'prompt user for start date/time --- you should probably add a validation step to make sure the user entered a valid date/time value
    dteStart = CDate(InputBox("Enter meeting start date and time, e.g. " & dteDefault, "Start Time", dteDefault))
        'prompt user for end date/time
    dteEnd = CDate(InputBox("Enter meeting end date and time, e.g. " & DateAdd("h", 1, dteDefault), "End Time", DateAdd("h", 1, dteDefault)))
   
    Set olCalendarItem = olOutlook.CreateItem(olAppointmentItem)
   
    With olCalendarItem
        .Subject = "This is the subject"    '<---- change to = Me.Room if that's the name of the combo box on your form
        .Body = "This is the body"
        .Location = "This is the location"
        .start = dteStart
        .End = dteEnd
        .ReminderSet = True
        .ReminderMinutesBeforeStart = 15
        .BusyStatus = olBusy
        .ResponseRequested = True
        .MeetingStatus = olMeeting
    End With
   
    Set olRecipient = olCalendarItem.Recipients.Add("preshomes@ee.com")    '<--- change to Me.Employee if that's the name of the combo box on your form
    olRecipient.Type = olTo
   
    olCalendarItem.Save
    olCalendarItem.Send

Exit_SendOutlookApptReminder:
    Set olRecipient = Nothing
    Set olMailItem = Nothing
    Set olCalendarItem = Nothing
    Set olOutlook = Nothing
    Exit Function

Err_SendOutlookApptReminder:
    MsgBox Err.Number & ", " & Err.Description, , "Error in Function SendOutlookApptReminder of Module Module1"
    Resume Exit_SendOutlookApptReminder
   
End Function
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question