Solved

Launch Outlook from form in Access

Posted on 2008-06-12
3
834 Views
Last Modified: 2013-11-29
I'm trying to launch Outlook from a form within Access, can can't get the VBA code right.
Also, I'm trying to open the calendar and tasks in new windows.

Here is some sample code I was invoking from a button control on an Access form, but I'm getting an "could not complete the operation. One or more parameter values are not valid" error.

Any help you could provide would be greatly appreciated.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
myFolder.Display
Set myOlApp = CreateObject("Outlook.Application")

Set myNameSpace = myOlApp.GetNameSpace("MAPI")

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

myFolder.Display

Open in new window

0
Comment
Question by:Dfunkt
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 21773717

    Dim oOutlook As Object
    Dim oNameSpace As Object
    Dim oInbox As Object
     
    Set oOutlook = CreateObject("Outlook.Application")
    Set oNameSpace = oOutlook.GetNamespace("MAPI")
    Set oInbox = oNameSpace.Folders(1)
     
 
    Set oInbox = oInbox.Folders("Inbox")
    oInbox.Display
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21774413
Dfunkt,

<Off Topic>

Again, why is this question not linked to the Outlook zone?
I thought that is what happened to the other Q?

I mean I thought that was the reason you closed the other Q?

I am sure that Cap has your answer here.

I'm just curious as to why you would close one "Outlook related" question. (That was not linked to the outlook Zone)
Only to open another "Outlook related" question. (That was not linked to the outlook Zone)
?
:-O

JeffCoachman
0
 

Author Closing Comment

by:Dfunkt
ID: 31466708
You Rock!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now