Prev: Retrieves last Changes users groups and computer objects
Next: unable to update HTA with WMI data.
From: ylafont on 12 Feb 2010 15:14 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 14 Feb 2010 13:44 "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 14 Feb 2010 15:14 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 14 Feb 2010 15:28 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 14 Feb 2010 23:24 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 > > >
|
Pages: 1 Prev: Retrieves last Changes users groups and computer objects Next: unable to update HTA with WMI data. |