?
Solved

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

Posted on 2006-11-29
3
Medium Priority
?
408 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 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

770 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