Solved

Launch Outlook from form in Access

Posted on 2008-06-12
3
843 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
[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
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

737 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