"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
Go Back  Xtreme Visual Basic Talk > > > > "set app = wscript.createobject ("Outlook.application")" fail. why?


Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2006, 03:46 AM
lordmelchett lordmelchett is offline
Regular
 
Join Date: Feb 2003
Posts: 67
Default "set app = wscript.createobject ("Outlook.application")" fail. why?


Hi all.
I have three laptops (all delivered with pre-installed WinXP/ Office 2003), that failes when I use the following code in a vbs file:

set app = wscript.createobject ("Outlook.application")


I get a windows script hos error witch says:

Error:"could not create object named outlook.application"
Code:8007007E
Source:Wscript.object


There might be an easy answer to this, but what can cause an easy call like this to fail?

Thanks in advance for your replies.
Jan
Reply With Quote
  #2  
Old 05-08-2006, 09:36 AM
Timbo's Avatar
Timbo"set app = wscript.createobject ("Outlook.application")" fail. why? Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

This might seem like a silly question, but I assume you are already running Outlook on the affected machines?
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
  #3  
Old 05-08-2006, 11:54 AM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Are you using VB.NET for this, VB 6.0 or VBScript for this?
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #4  
Old 05-08-2006, 02:46 PM
lordmelchett lordmelchett is offline
Regular
 
Join Date: Feb 2003
Posts: 67
Default

Thanks for your reply.
Yes, outlook is running.
I have tried it minimized to tray and opened.
Reply With Quote
  #5  
Old 05-08-2006, 02:48 PM
lordmelchett lordmelchett is offline
Regular
 
Join Date: Feb 2003
Posts: 67
Default

Hi Mike.
I am using vbscript.

simply written in notepad,then changed the extension to *.vbs.
Reply With Quote
  #6  
Old 05-08-2006, 03:02 PM
NateO's Avatar
NateO NateO is offline
Excellent…

Forum Leader
* Expert *
 
Join Date: Jun 2004
Location: Minneapolis MN - deceased
Posts: 2,483
Default

You don't want Windows Script for this, try the following:

Code:
Dim appOutlook, objNs, objInbox Set appOutlook = CreateObject("Outlook.Application") Set objNs = appOutlook.GetNamespace("MAPI") Set objInbox = objNs.GetDefaultFolder(6) objInbox.Display Set objInbox = Nothing: Set objNs = Nothing Set appOutlook = Nothing
In a .vbs file.
__________________
Regards,
Nate Oliver
Microsoft Excel MVP
Reply With Quote
  #7  
Old 05-08-2006, 03:19 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Ok, we'll get this moved out of the .NET section then...

And then hopefully someone else can help out because I'm pretty bad at VBScript, I'm afraid.

I can't get it to work either. Kicking it around, the following two work fine for me for Excel:
Code:
dim app set app = CreateObject("Excel.Application") app.Visible = True msgbox "See it?"
and:
Code:
dim app set app = GetObject("","Excel.Application") app.Visible = True msgbox "See it?"
But neither works when using "Outlook.Application". I really do not know why not... Hopefully someone else with a clue will swing by!

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why? "set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
 
"set app = wscript.createobject ("Outlook.application")" fail. why?
"set app = wscript.createobject ("Outlook.application")" fail. why?
 
-->