PC Review


Reply
Thread Tools Rate Thread

Can't even capture if Outlook is running

 
 
Lester Lane
Guest
Posts: n/a
 
      19th Oct 2010
Hi,
I have upgraded to 2010 and when Access is running my code it won't
even detect if Outlook 2010 is running nor will
it create a new instance (failed with a 429 - ActiveX can't create
error).

I also remember that using 2010 one can pick an account to send
through and I
guess the whole routine could be made slicker. I'm at a loss even
using the "help" screens. Thanks.

Dim objOutlook As Object ' Note: Must be late-binding.
Dim objNameSpace As Object
Dim objExplorer As Object
Dim blnSuccessful As Boolean
Dim blnNewInstance As Boolean
Dim strFailed As String
Dim i As Integer

'Is an instance of Outlook already open that we can bind to?
On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application") ==== fails to find
running program
On Error GoTo ErrTrap

If objOutlook Is Nothing Then

'Outlook isn't already running - create a new instance...
Set objOutlook = CreateObject("Outlook.Application") ==== fails
with 429 can't create error
blnNewInstance = True
'We need to instantiate the Visual Basic environment... (messy)
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objExplorer =
objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
objExplorer.CommandBars.FindControl(, 1695).Execute

objExplorer.Close

Set objNameSpace = Nothing
Set objExplorer = Nothing

End If
......... more code .......

I also had some code in Outlook 2003 that allowed me to bypass the
annoying messages when I sent emails from Access 2003. Do I still
need this or has Outlook improved since 2003 re thinking it is under
attack?!
 
Reply With Quote
 
 
 
 
Ken Slovak
Guest
Posts: n/a
 
      19th Oct 2010
Is this Access/Outlook 32 or 64 bit?

I haven't tested running any Outlook automation code from Access in 2010,
but one of the Access MVP's was posting in this group in a thread titled
"Problem automating Outlook in Windows 7 from VB6 and Access" about a
problem with VB6 code and Outlook automation. You might want to look at that
thread and see if Tony's batch file workaround has any effect on your
situation.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Lester Lane" <(E-Mail Removed)> wrote in message
news:45fb5d02-57cc-4f46-8793-(E-Mail Removed)...
> Hi,
> I have upgraded to 2010 and when Access is running my code it won't
> even detect if Outlook 2010 is running nor will
> it create a new instance (failed with a 429 - ActiveX can't create
> error).
>
> I also remember that using 2010 one can pick an account to send
> through and I
> guess the whole routine could be made slicker. I'm at a loss even
> using the "help" screens. Thanks.
>
> Dim objOutlook As Object ' Note: Must be late-binding.
> Dim objNameSpace As Object
> Dim objExplorer As Object
> Dim blnSuccessful As Boolean
> Dim blnNewInstance As Boolean
> Dim strFailed As String
> Dim i As Integer
>
> 'Is an instance of Outlook already open that we can bind to?
> On Error Resume Next
> Set objOutlook = GetObject(, "Outlook.Application") ==== fails to find
> running program
> On Error GoTo ErrTrap
>
> If objOutlook Is Nothing Then
>
> 'Outlook isn't already running - create a new instance...
> Set objOutlook = CreateObject("Outlook.Application") ==== fails
> with 429 can't create error
> blnNewInstance = True
> 'We need to instantiate the Visual Basic environment... (messy)
> Set objNameSpace = objOutlook.GetNamespace("MAPI")
> Set objExplorer =
> objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
> objExplorer.CommandBars.FindControl(, 1695).Execute
>
> objExplorer.Close
>
> Set objNameSpace = Nothing
> Set objExplorer = Nothing
>
> End If
> ........ more code .......
>
> I also had some code in Outlook 2003 that allowed me to bypass the
> annoying messages when I sent emails from Access 2003. Do I still
> need this or has Outlook improved since 2003 re thinking it is under
> attack?!


 
Reply With Quote
 
Lester Lane
Guest
Posts: n/a
 
      20th Oct 2010
On 19 Oct, 23:30, "Ken Slovak" <kenslo...@mvps.org> wrote:
> Is this Access/Outlook 32 or 64 bit?
>
> I haven't tested running any Outlook automation code from Access in 2010,
> but one of the Access MVP's was posting in this group in a thread titled
> "Problem automating Outlook in Windows 7 from VB6 and Access" about a
> problem with VB6 code and Outlook automation. You might want to look at that
> thread and see if Tony's batch file workaround has any effect on your
> situation.
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm
>
> "Lester Lane" <ja...@pigottsinvestments.co.uk> wrote in message
>
> news:45fb5d02-57cc-4f46-8793-(E-Mail Removed)...
>
> > Hi,
> > I have upgraded to 2010 and when Access is running my code it won't
> > even detect if Outlook 2010 is running nor will
> > it create a new instance (failed with a 429 - ActiveX can't create
> > error).

>
> > I also remember that using 2010 one can pick an account to send
> > through and I
> > guess the whole routine could be made slicker. *I'm at a loss even
> > using the "help" screens. *Thanks.

>
> > Dim objOutlook As Object ' Note: Must be late-binding.
> > Dim objNameSpace As Object
> > Dim objExplorer As Object
> > Dim blnSuccessful As Boolean
> > Dim blnNewInstance As Boolean
> > Dim strFailed As String
> > Dim i As Integer

>
> > 'Is an instance of Outlook already open that we can bind to?
> > On Error Resume Next
> > Set objOutlook = GetObject(, "Outlook.Application") ==== fails to find
> > running program
> > On Error GoTo ErrTrap

>
> > If objOutlook Is Nothing Then

>
> > * *'Outlook isn't already running - create a new instance...
> > * *Set objOutlook = CreateObject("Outlook.Application") ==== fails
> > with 429 can't create error
> > * *blnNewInstance = True
> > * *'We need to instantiate the Visual Basic environment... (messy)
> > * *Set objNameSpace = objOutlook.GetNamespace("MAPI")
> > * *Set objExplorer =
> > objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
> > * *objExplorer.CommandBars.FindControl(, 1695).Execute

>
> > * *objExplorer.Close

>
> > * *Set objNameSpace = Nothing
> > * *Set objExplorer = Nothing

>
> > End If
> > ........ more code .......

>
> > I also had some code in Outlook 2003 that allowed me to bypass the
> > annoying messages when I sent emails from Access 2003. *Do I still
> > need this or has Outlook improved since 2003 re thinking it is under
> > attack?!


Thanks for the pointer to a nightmare of a problem! It seems like it
might be similar but Tony was having issues with Access if it was
triggered by a VB6 program/batch file. If Access was run from
Explorer then things seemed to work. My problem is that Access, run
normally, will not even pick up that Outlook is running using
GetObject(, "Outlook.Application") as it remains equal to Nothing.
Maybe my issues are security driven as I have not played (lowered)
theses settings yet can you let me know what I should be making sure
is set? Thanks a lot.

James
 
Reply With Quote
 
Ken Slovak
Guest
Posts: n/a
 
      20th Oct 2010
You didn't answer my question, is this 32 or 64 bit Access and Outlook?

Do you have up-to-date anti-virus software running? Under most circumstances
now with up-to-date anti-virus software running the old object model guard
is disabled and you can run standalone code with no problems. For security
settings you have to look at the Trust Center settings, I don't have Outlook
or Access 2010 open here right now but check the settings for macros and
macro code.

Another possible problem is anti-virus software. Some of them have script
stoppers. If you are running a product like that you may be out of luck,
some don't let you trust anything (Norton) while others do allow you to
trust code (McAfee). If a script stopper is doing that you're out of luck
unless you can tell it to trust the code or you uninstall it and reinstall
without the script stopper.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Lester Lane" <(E-Mail Removed)> wrote in message
news:42c7ea54-9a47-4baa-bcc6-(E-Mail Removed)...
<snip>
Thanks for the pointer to a nightmare of a problem! It seems like it
might be similar but Tony was having issues with Access if it was
triggered by a VB6 program/batch file. If Access was run from
Explorer then things seemed to work. My problem is that Access, run
normally, will not even pick up that Outlook is running using
GetObject(, "Outlook.Application") as it remains equal to Nothing.
Maybe my issues are security driven as I have not played (lowered)
theses settings yet can you let me know what I should be making sure
is set? Thanks a lot.

James

 
Reply With Quote
 
Tony Toews
Guest
Posts: n/a
 
      21st Oct 2010
On Wed, 20 Oct 2010 14:02:10 -0400, "Ken Slovak" <(E-Mail Removed)>
wrote:

>Do you have up-to-date anti-virus software running? Under most circumstances
>now with up-to-date anti-virus software running the old object model guard
>is disabled and you can run standalone code with no problems.


Oh, is that what has caused the change with Outlook. I didn't realize
that current anti-virus software was the reason.

>Another possible problem is anti-virus software. Some of them have script
>stoppers. If you are running a product like that you may be out of luck,
>some don't let you trust anything (Norton) while others do allow you to
>trust code (McAfee). If a script stopper is doing that you're out of luck
>unless you can tell it to trust the code or you uninstall it and reinstall
>without the script stopper.


Access code isn't really a scripting language though.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
 
Reply With Quote
 
Ken Slovak
Guest
Posts: n/a
 
      21st Oct 2010
No, but Norton intercepts GetObject() and CreateObject() calls and can
disable them. Even if the code is actually VBA or even VB6 Norton will get
it's greasy hands into the mix and screw everything up. Not just Norton of
course, they're just the worst. Any script stopper can do that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Tony Toews" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 20 Oct 2010 14:02:10 -0400, "Ken Slovak" <(E-Mail Removed)>
> wrote:
>
>>Do you have up-to-date anti-virus software running? Under most
>>circumstances
>>now with up-to-date anti-virus software running the old object model guard
>>is disabled and you can run standalone code with no problems.

>
> Oh, is that what has caused the change with Outlook. I didn't realize
> that current anti-virus software was the reason.
>
>>Another possible problem is anti-virus software. Some of them have script
>>stoppers. If you are running a product like that you may be out of luck,
>>some don't let you trust anything (Norton) while others do allow you to
>>trust code (McAfee). If a script stopper is doing that you're out of luck
>>unless you can tell it to trust the code or you uninstall it and reinstall
>>without the script stopper.

>
> Access code isn't really a scripting language though.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
> For a convenient utility to keep your users FEs and other files
> updated see http://www.autofeupdater.com/


 
Reply With Quote
 
Tony Toews
Guest
Posts: n/a
 
      21st Oct 2010
On Thu, 21 Oct 2010 11:52:45 -0400, "Ken Slovak" <(E-Mail Removed)>
wrote:

>No, but Norton intercepts GetObject() and CreateObject() calls and can
>disable them. Even if the code is actually VBA or even VB6 Norton will get
>it's greasy hands into the mix and screw everything up. Not just Norton of
>course, they're just the worst. Any script stopper can do that.


Ahhh, I was unaware of that.

Thanks, Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook add-in, add-in for outlook, outlook contact capture, capturecontacts into outlook, outlook add-on, address capture, capture name,addresses, import contacts to Outlook, transfer contact details into outlook Dhan Microsoft Outlook Program Addins 0 24th Apr 2010 09:03 AM
Outlook add-in that captures name,address,phone,email to Outlook bycontact capture software Dhan Microsoft Outlook Program Addins 0 15th Apr 2010 01:24 PM
Capture control as image when running in background aledrjones@gmail.com Microsoft C# .NET 3 6th Mar 2006 04:00 PM
Two copies of Outlook running (or at least two windows running) when I launch Outlook 2003 in Cached Exchange Mode... News Reader Microsoft Outlook 0 24th Jun 2004 09:15 PM
capture full screen from an old MS-DOS program running under XP VK Freeware 5 17th Oct 2003 09:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:26 AM.