A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Opening Outlook from Access



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 18th 07, 02:00 AM posted to microsoft.public.outlook.program_vba
NevilleT
external usenet poster
 
Posts: 2
Default Opening Outlook from Access

I am trying to send an email with an attachment from Access 2007. I ran into
problems with getObject and createObject. The object is "Nothing" even if
Outlook is open. To try and isolate the problem, I created a new database to
do some testing with the following module

Sub test()

Dim objApp As Object
Dim blnOutlookInitiallyOpen As Boolean

On Error Resume Next

blnOutlookInitiallyOpen = True

Set objApp = GetObject(, "Outlook.Application")
If objApp Is Nothing Then
Set objApp = CreateObject("Outlook.Application")
' Outlook wasn't open when this function started.
blnOutlookInitiallyOpen = False
End If

If Err 0 Then Beep: _
MsgBox "Error in " & strProcName & " (1): " _
& Err.Number & " - " & Err.Description: _

End Sub

References are
- Visual Basic for Applications
- Microsoft Access 12.0 Object Library
- Microsoft Outlook 12.0 Object Library
- OLE Automation
- Microsoft DAO 3.6 Object Library

I posted the message on an Access Newsgroup and it was suggested that the
issue could be binding. I am not sure I really understand early and late
binding in spite of some technical stuff I have read but it doesn't seem to
change the situation.

I changed
Dim objApp As Outlook.Application
to:
Dim objApp As Object

Still get error 429 - Active X component can't create object.

I turned off Kaspersky AV and it made no difference. Not sure what to try
next.
Ads
  #2  
Old October 18th 07, 04:44 AM posted to microsoft.public.outlook.program_vba
NevilleT
external usenet poster
 
Posts: 2
Default Opening Outlook from Access

Seems I managed to solve the problem on my own. The answer seemed to be to
run Office Diagnostics in Access 2007. It didn't report any errors but after
running that, suddenly objects were recognised. I had never heard of it
before but found a post on a newsgroup to either run Office Diagnostics in
Office 2007 or Detect and Repair in earlier versions. Thanks to Sue Mosher.
Check
http://www.devnewsgroups.net/group/m...opic58421.aspx

"NevilleT" wrote:

I am trying to send an email with an attachment from Access 2007. I ran into
problems with getObject and createObject. The object is "Nothing" even if
Outlook is open. To try and isolate the problem, I created a new database to
do some testing with the following module

Sub test()

Dim objApp As Object
Dim blnOutlookInitiallyOpen As Boolean

On Error Resume Next

blnOutlookInitiallyOpen = True

Set objApp = GetObject(, "Outlook.Application")
If objApp Is Nothing Then
Set objApp = CreateObject("Outlook.Application")
' Outlook wasn't open when this function started.
blnOutlookInitiallyOpen = False
End If

If Err 0 Then Beep: _
MsgBox "Error in " & strProcName & " (1): " _
& Err.Number & " - " & Err.Description: _

End Sub

References are
- Visual Basic for Applications
- Microsoft Access 12.0 Object Library
- Microsoft Outlook 12.0 Object Library
- OLE Automation
- Microsoft DAO 3.6 Object Library

I posted the message on an Access Newsgroup and it was suggested that the
issue could be binding. I am not sure I really understand early and late
binding in spite of some technical stuff I have read but it doesn't seem to
change the situation.

I changed
Dim objApp As Outlook.Application
to:
Dim objApp As Object

Still get error 429 - Active X component can't create object.

I turned off Kaspersky AV and it made no difference. Not sure what to try
next.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening *.PST file: "Can't open this item. Outlook blocked access to this potentially unsafe item." R2D2 Outlook - General Queries 1 September 16th 07 08:14 AM
Remote Access or shared LAN access of Outlook without using Exchange Server ???? Synapse Syndrome Outlook - General Queries 8 June 22nd 07 09:11 PM
Remote Access or shared LAN access of Outlook without using Exchange Server ???? Synapse Syndrome Add-ins for Outlook 8 June 22nd 07 09:11 PM
Is it possible to access Outlook from home without web access, an. Rob King Outlook - Installation 1 January 5th 07 08:29 PM
Outlook should access Outlook Web Access to sync schedule. OvertaDover Outlook - Calandaring 2 July 5th 06 01:42 AM


All times are GMT +1. The time now is 05:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.