Jump to content

pendragon

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by pendragon

  1. Oops....sorry. Someone decided to install office to a non standard location on this pc I'm testing with. Silly me! I guess that points out one potential flaw with my script though! Thanks
  2. Yes, have done the debugging and $OfficeVersion is returning correctly. What version of Autoit do you have? I've got Win7/x64 and Office 2007 as well and it just won't launch outlook. No errors or anything, the script just runs and exits without launching.
  3. Rather than banging my head against the desk anymore, can someone tell me why this won't work....I always seem to get stuck when it comes to the use of quotes and joining strings! Grrr! Global $OfficeVersion $objWord = ObjCreate("Word.Application") $OfficeVersion = $objWord.Version $objWord.Quit Switch $OfficeVersion Case "9.0" $OfficeVersion = "Office9" Case "10.0" $OfficeVersion = "Office10" Case "11.0" $OfficeVersion = "Office11" Case "12.0" $OfficeVersion = "Office12" Case "14.0" $OfficeVersion = "Office14" EndSwitch Run("C:\Program Files (x86)\Microsoft Office\" & $OfficeVersion & "\Outlook.exe","")
  4. Hi, I'm new to this, and I'm a bit stumped on this. I'm trying to use autoit to check devices for a battery, unfortunatley, when I run this on a computer that doesn't have a battery, it spits out the following: AutoIT Error Line -1: Error: Variable must be of the type "Object". How can I avoid/hide this error when the script runs against devices without a battery? When the code is executed on a device with a battery, it functions fine. The code: Dim $sAns $WMI = ObjGet("WinMgmts:") $objs = $WMI.InstancesOf("Win32_Battery") $iCount = 1 For $obj In $objs $sAns = $sAns & $obj.Caption If $iCount < $objs.Count Then $sAns = $sAns & "," $iCount += 1 Next If $obj.Caption <> 'Internal Battery' Then Msgbox(0,"Yay","It works!") If anyone can help, I'd appreciate it
×
×
  • Create New...