From: ylafont on
I have a basic script below to lauch outlook and close it back up however it
seems to hang on the the "Set objOutlook =
CreateObject("Outlook.Application") " line. and i cant seem to figure out
why. Outlook lauches, but never closes. when i manually terminat the process
it give the error

"ActiveX Component Cant Create Object: 'Outlook.Applcation'

I am missing something? please let me know is possible

***********Script ************************8

Dim objFolder
Dim objNamespace
Dim objProcesses
Dim objProcess
Const olFolderInbox = 6



Dim obshell
set ObjShell = CreateObject("wscript.Shell")

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
objNamespace.Logon "Default Outlook Profile",, False, True

Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
objFolder.Display


objOutlook.Session.logoff
objOutlook.Quit
Set objOutlook = Nothing

Set objProcesses = GetObject("WinMgmts:root/CIMV2").ExecQuery("SELECT * FROM
Win32_Process WHERE Name='OUTLOOK.EXE'")

For Each objProcess In objProcesses
objProcess.Terminate
Next

From: urkec on
"ylafont" wrote:

> I have a basic script below to lauch outlook and close it back up however it
> seems to hang on the the "Set objOutlook =
> CreateObject("Outlook.Application") " line. and i cant seem to figure out
> why. Outlook lauches, but never closes. when i manually terminat the process
> it give the error
>
> "ActiveX Component Cant Create Object: 'Outlook.Applcation'
>
> I am missing something? please let me know is possible
>

According to the message you are missing an 'i' in 'Outlook.Applcation'


--
urkec
From: ylafont on
unforrunatly that was type in my message, the script has it spelled
correctly. any clue ?

"urkec" wrote:

> "ylafont" wrote:
>
> > I have a basic script below to lauch outlook and close it back up however it
> > seems to hang on the the "Set objOutlook =
> > CreateObject("Outlook.Application") " line. and i cant seem to figure out
> > why. Outlook lauches, but never closes. when i manually terminat the process
> > it give the error
> >
> > "ActiveX Component Cant Create Object: 'Outlook.Applcation'
> >
> > I am missing something? please let me know is possible
> >
>
> According to the message you are missing an 'i' in 'Outlook.Applcation'
>
>
> --
> urkec
From: Mike B on
Did you test with GetObject first to see if there was an instance of Outlook
running before calling CreateObject?

"ylafont" <ylafont(a)discussions.microsoft.com> wrote in message
news:B15FA589-632B-4713-B08D-6032C329E062(a)microsoft.com...
> unforrunatly that was type in my message, the script has it spelled
> correctly. any clue ?
>
> "urkec" wrote:
>
>> "ylafont" wrote:
>>
>> > I have a basic script below to lauch outlook and close it back up
>> > however it
>> > seems to hang on the the "Set objOutlook =
>> > CreateObject("Outlook.Application") " line. and i cant seem to figure
>> > out
>> > why. Outlook lauches, but never closes. when i manually terminat the
>> > process
>> > it give the error
>> >
>> > "ActiveX Component Cant Create Object: 'Outlook.Applcation'
>> >
>> > I am missing something? please let me know is possible
>> >
>>
>> According to the message you are missing an 'i' in 'Outlook.Applcation'
>>
>>
>> --
>> urkec



From: Al Dunbar on
And here is another hint: when asking for help with a script paste it (or
perhaps just the part in question for a long script) into your post. We
don't know what differences there might be between what you posted and the
script you are running other than just the one spelling error.


/Al


"Mike B" <mDotByerley(a)VerizonDottieNettie> wrote in message
news:uM4N9QbrKHA.728(a)TK2MSFTNGP04.phx.gbl...
> Did you test with GetObject first to see if there was an instance of
> Outlook running before calling CreateObject?
>
> "ylafont" <ylafont(a)discussions.microsoft.com> wrote in message
> news:B15FA589-632B-4713-B08D-6032C329E062(a)microsoft.com...
>> unforrunatly that was type in my message, the script has it spelled
>> correctly. any clue ?
>>
>> "urkec" wrote:
>>
>>> "ylafont" wrote:
>>>
>>> > I have a basic script below to lauch outlook and close it back up
>>> > however it
>>> > seems to hang on the the "Set objOutlook =
>>> > CreateObject("Outlook.Application") " line. and i cant seem to
>>> > figure out
>>> > why. Outlook lauches, but never closes. when i manually terminat the
>>> > process
>>> > it give the error
>>> >
>>> > "ActiveX Component Cant Create Object: 'Outlook.Applcation'
>>> >
>>> > I am missing something? please let me know is possible
>>> >
>>>
>>> According to the message you are missing an 'i' in 'Outlook.Applcation'
>>>
>>>
>>> --
>>> urkec
>
>
>