VBA code for Outlook doesn't works in some cases

K

Kalyan

Hi everyone,
I have developed a vbscript in a webapplication to access Outlook
addressbook which uses Outlook API and Redemption. It is working. However, in
particular a particular scenario, When try my application with IE7 and
Outlook 2003, It can't able to create "Outlook.Application" object. And my
application is developed in .Net with some Flash controls(SWF).
Note: If I try the vbscript from a simple HTML its working fine in same
scenario (IE7 and Outlook2003)
Can anybody help me on this?What should I do to make it work in application
with Flash component?
 
K

Ken Slovak - [MVP - Outlook]

Not being able to create an Outlook.Application object has nothing to do
with your HTML or using Flash. That may still be a problem but has nothing
to do with this.

Are you running the actual code on the same machine and in the same domain
as when you test? Is there anything running on the machine where it fails
that could prevent a script from using CreateObject or GetObject or New.
What you'd be looking for is some sort of script stopper, often they come
with anti-virus packages such as Norton and McAfee or with software
firewalls.
 
K

Kalyan

In the same machine..
When I call from a simple HTML page, the same vbscript code is working fine.
But thru the application it is not creating the object. In application I'm
using Flash control(FLEX) and calling the script thru ActionScript.

Application works fine in (machines in same domain with similar
configuration) having [IE7 and Outlook 2007],[IE6 and Outlook 2003],[IE6 and
Outlook 2007]
 
K

Ken Slovak - [MVP - Outlook]

Then there might be some problem with Flash or how you're calling the script
from ActionScript, whatever that is. I try to avoid Flash like the plague so
I can't help with that.
 
N

Norman Yuan

VBA code? If your application is a web application, it runs by a web server.
Since you said "vbscript", I assume the web server is IIS.

Firstly, is this web application is only meant for single user (since it
automate an Outlook)? Do you automation Outlook with server side code (the
web application) or with client side script (can be javascript or vbscript,
since you use IE). Note, even you run whole thing in the same computer,
there is still difference between server side code and client side code.

Secondly, if you use server side code to automate Outlook, you have to make
sure the account used by IIS/web server to run your web app has the
permission to run Outlook (usually not, for most type of web app, such as
ASP.NET. BTW, what kind of web app is it?).

Finally, if your app runs on a server computer, you need to install Outlook
to that server computer (but which user profile the Outlook should be
configured to use? I do not know). If your app is meant to automate user's
Outlook, server side code cannot do that unless the web app runs on each
users' computer (then users' computer must have IIS installed).
 
K

Kalyan

Hi Norman,

1. Its a web application running in IIS, used by multiple users. It contains
some Flash(SWF) UI controls
2. VBScript -is clientside script invoked on button click. It accesses the
outlook on user's (client) computer.
3. The application is WORKING FINE in these combination [IE6 & Outlook
2003],[IE6 and Outlook 2007][IE7 & Outlook 2007] on all the Windows machine
that have these IE and outlook versions
4. The PROBLEM is its NOT working in "IE7 & Outlook 2003" combination.
5. However, when I write a simple (Seperate) HTML file with same
vbscript(clientside) and invoke the function, Its woking fine.
The line below gives "Cannot create object" error (in #4 combination)

Set objOutlook1 = CreateObject("Outlook.Application")

I hope this is clear. Is there any compatability issue with Flash activex
and the above "CreateObject"
OS : Windows XP Professional SP2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top