Solved

Access + Outlook + Late Binding - Saving an appointment rather than displaying it.

Posted on 2006-11-29
3
401 Views
Last Modified: 2008-03-17
Hi All,

I am slowly getting to grips (thanks to EE), with using Late binding to Outlook via MS Access 2003.  However, I can't solve one final issue.

My application currently allows the user to email an appointment, stored in the Access database, as a VCalendar to who ever needs it.  Using early binding this works fine using the following code:

With objRem
  'Field population goes here

  .SaveAs "C:\Foldername\Filename.vcs", olVCal
End with


I then create an email and attach this file.  For some reason I cannot use the olVCal part when using late binding.

Any ideas?

All the best
0
Comment
Question by:Andy Brown
[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
  • 2
3 Comments
 
LVL 84
ID: 18036891
When using Late Binding the constants associated with the library won't be available unless you make them so. The easiest way to do it is to determine the acutal value of those constants and declare them in a Standard Module in your database:

Public Const olVCal As Long = 1
Public Const olVSomeotherValue As Long = 2

etc etc.

You can determine the value of your constants by remaking a reference to the Outlook library and then use the Object Browser to locate the constants you need.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 18036940
As an example, the value of olVCal is 7, so you'd need to do this:

Public Const olVCal As Long = 7

Other members of this enumaration (which is named OLSaveAsType) are:

olDoc =4
olHTML = 5
olCal = 8
olMHTML = 10
olMSG = 3
omMSGUnicode = 9
olRTF = 1
olTemplate = 2
olTXT = 7
olVCard = 6

The ONLY trouble with this approach is if Microsoft were to change the value of a constant ... say they decided, in Outlook 23, to change the value of olVCal to 122 ... if this were to happen, then your code would fail IF it were run on a machine with Outlook 23 installed. That said, the constant values almost never change (I can't recall an instance where they did), so your constant declarations should work fine.
0
 

Author Comment

by:Andy Brown
ID: 18037008
Perfect - thank you very much (again)

Really appreciated.

All the best.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query Dilema in Access 2010 3 37
Fields don't match on a query 9 44
MS Access query 16 59
Converting Access 2016 from 32-bit to 64-bit 8 57
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

734 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