Hate to be beating a dead horse...Wait...No I don't...Die horse die...

Anyways...

I added some code to get the other GUID needed to install updates as well.

Unfortunately I'm not too experienced when it comes to writing functions...Is there any way to return multiple values without using an array?

code:
 
Break On

For Each $officedata in OfficeProduct()
? $officedata
Next

get $

FUNCTION OfficeProduct(optional $computer)
DIM $index, $err, $office, $product, $officekey, $UninstallKey, $InstallerKey
$UninstallKey = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\"
$InstallerKey = "HKLM\Software\Classes\Installer\Products\"
If $Computer
$UninstallKey = "\\"+$computer+"\"+$UninstallKey
$InstallerKey = "\\"+$computer+"\"+$InstallerKey
EndIf
Do
$product = ReadValue($UninstallKey+$officekey,"DisplayName")
If InStr($product, "Microsoft Office")
$MSOguid = $UninstallKey+$officekey
$InstallerGUID = SubStr($MSOguid, InStr ($MSOguid, "{")+1, Len ($MSOguid)-1)
For $x=1 to Len("$InstallerGUID")
$null = execute ("$$c$x = SubStr($$InstallerGUID, $x, 1)")
Next
$InstallerGUID = $InstallerKey+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1+$c13+$c12+$c11+$c10+$c18+$c17+$c16+$c15+$c21+$c20+$c23+$c22+$c26+$c25+$c28+$c27+$c30+$c29+$c32+$c31+$c34+$c33+$c36+$c35
$Version = ReadValue ($UninstallKey+$officekey,"DisplayVersion")
$OfficeProduct = $product,$version,$msoguid,$installerguid
Endif
$officekey = ENUMKEY($UninstallKey, $index)
$index = $index + 1
Until @error or $officeproduct[0]
Exit @error
ENDFUNCTION