Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Chapel Hill, North Carolina, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way to send a vCal file via Access 2003 VBA? I want Access to send a calendar item to remind staff of deadlines? is there another way for Access to send a calendar invite?

    Thanks!

    Larry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you're using Outlook, you can automate Outlook from Access to either send a message with a vCal file attached, or to send a meeting request.

    See for example Post 728849

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Chapel Hill, North Carolina, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Hans - this is very helpful. I'll planning to build the vCal file and then attach. I was looking around on the Microsoft MSN libraries at http://msdn.microsoft.com/en-us/library/aa...office.11).aspx and found this code, but I get an error message ("Object variable or With block variable not set") when I try to run it. Thanks again! Larry

    Original code:

    Set myItem = myOlApp.CreateItem(olAppointmentItem)
    myItem.MeetingStatus = olMeeting
    myItem.Subject = "Strategy Meeting"
    myItem.Location = "Conference Room B"
    myItem.Start = #9/24/97 1:30:00 PM#
    myItem.Duration = 90
    Set myRequiredAttendee = myItem.Recipients.Add("Nate _
    Sun")
    myRequiredAttendee.Type = olRequired
    Set myOptionalAttendee = myItem.Recipients.Add("Kevin _
    Kennedy")
    myOptionalAttendee.Type = olOptional
    Set myResourceAttendee = _
    myItem.Recipients.Add("Conference Room B")
    myResourceAttendee.Type = olResource
    myItem.Send


    My code:

    Dim myOlApp As Object
    Dim myItem As Outlook.MeetingItem - **** I've tried this with Outlook.AppointmentItem also
    Dim myDelegate As Outlook.Recipients
    Set myItem = myOlApp.CreateItem(olAppointmentItem)
    myItem.MeetingStatus = olMeeting
    myItem.Subject = "Strategy Meeting"
    myItem.Location = "Conference Room B"
    myItem.Start = #9/24/2008 1:30:00 PM#
    myItem.Duration = 15

    Set myRequiredAttendee = myItem.Recipients.Add("test@microsoft.com")
    myItem.Send

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You declare a variable

    Dim myOlApp As Object

    but you don't set it anywhere. Since you appear to have set a reference to the Microsoft Outlook 11.0 Object Library, I'd change the declaration to

    Dim myOlApp As New Outlook.Application

    The use of the keyword New ensures that an instance of Outlook will be created.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    [quote name='lmandel' post='779681' date='13-Jun-2009 12:00']... but I get an error message ("Object variable or With block variable not set") when I try to run it. Thanks again! Larry[/quote]
    Automation of Outlook in particular gets rather tricky. I think you have failed to define one or more of the objects necessary to do what you are trying to.

    This is an example of the DIM statments I use to send an email with an attachment:
    Code:
    		  Dim myOutlook As Outlook.Application
    		  Dim myOutlookMsg As Outlook.MailItem
    		  Dim myOutlookRecip As Outlook.Recipient
    		  Dim myOutlookAttch As Outlook.Attachment
    I think the issue may be with your statement
    Dim myOlApp As Object
    Wendell

Posting Permissions

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