[RSLVD] createobject for outlook message error
ok I get an " ActiveX object cant create object" error 429
I know its because we have this new Cisco security agent.. that
is blocking it.. unless I move the security to low.. so my question is
how can I make it bypass this error and not crash... I tried to make
a on error goto CantOpenObject... but it doesnt do it.. it just errors
and crashes the program.. I want to make it tell them to change
the settings..(really I want Cisco to allow my program to do it, but
there is not Allow list in it, only deny and its not in the deny)..
so anyone know how I cant test if it will allow it and then display and
not crash ?
Re: createobject for outlook message error
If you are running Outlook in an Exchange server environment then you can use the Exchange servers management functionality to allow your control/app to run.
Re: createobject for outlook message error
actually I was talking to a co-worker to seconds after I wrote this..
he was opening outlook another way.. he had it referenced at design time
not at runtime like I was.. seems Cisco doesnt care if you have it referenced
in at design time only run time... so I rekon I'll make it call it that way from
now on..
thanks though.. see if below makes sense to you
incase another search finds this post
old way ..no Reference added
VB Code:
Dim objFileSys As New FileSystemObject
If objFileSys.FileExists(dirDirectory.Path & "\" & filFiles.FileName) Then 'If exists then proceed
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
new way .. needs Microsoft Outlook added as reference.
VB Code:
Dim oApp As New Outlook.Application
Dim oEmail As Outlook.MAPIFolder
Dim oNameSpace As Outlook.Namespace
Set oNameSpace = oApp.GetNamespace("MAPI")
Set oEmail = oNameSpace.GetDefaultFolder(olFolderInbox)
With oEmail.Items.Add(olMailItem)
Re: createobject for outlook message error
Ok, you are now doing Early Binding. The main thing to watch out for when used on other systems is that what ever Outlook version you reference on the system you are compiling this on is going to be required on any system that uses it and since Outlook only lets you have one version instaled it is a bit restrictive. This is where Late Binding really helps out (what you were doing earlier). It allows the code to bind to whatever Outlook version s installed.
Re: createobject for outlook message error
ok that makes perfect sense... maybe I will look into getting the access
issue fixed.. this is a internal corp program only ( we all have the same
outlook version) so I could do the new way.. but good to know..
thanks a bunch.. :thumb: :thumb: :thumb:
Re: [RSLVD] createobject for outlook message error
ha.. foiled again.. not cisco gets blocks this call..
Set oNameSpace = oApp.GetNamespace("MAPI")
so I guess I need to find a way to have Cisco think its an ok program..
Re: [RSLVD] createobject for outlook message error
Do you also run an Exchange Server?