Jump to content

Recommended Posts

Posted

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","")
Posted

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.

Works for me on Win7/x64 Office 2007.

What is the problem?

Have you put in dome debugging statements to figure out what info is returned to $OfficeVersion?

Posted

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

autoit3_x64.exe ver 3.3.6.1

What is the value of $OfficeVersion after the Case and before the run?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...