Thank you Mark, John and Roland!
This was definitely a research project! All the different versions and configurations of Outlook was getting tough to decipher. In the end, I decided on Mark's solution 2...
Here's the code now... it's in the pfc_postopen event. ue_no_email disables the email options on the window and notifies the user.
//Check to see if the Outlook "bitness" matches the BT "bitness"
string ls_directory, ls_path
integer li_rc, li_BtBitness, li_Outlook
ulong ll_OutlookBitness
boolean lb_rc
environment lenv_object
li_rc = RegistryGet ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", &
"Path", RegString!, ls_directory)
if (li_rc = -1) then
this.Post Event ue_no_email()
return
else
lb_rc = GetBinaryTypeW( ls_directory + "\OUTLOOK.EXE", ll_OutlookBitness)
if lb_rc = FALSE then
this.Post Event ue_no_email()
return
elseif ll_OutlookBitness = 0 then
ll_OutlookBitness = 32
elseif ll_OutlookBitness = 6 then
ll_OutlookBitness = 64
end if
GetEnvironment (lenv_object)
li_BtBitness = lenv_object.processbitness
if li_BtBitness <> ll_OutlookBitness then
this.Post Event ue_no_email()
return
end if
end if
In the application object I declared the global external function: FUNCTION boolean GetBinaryTypeW( string lpApplicationName, ref ulong lpBinaryType) LIBRARY "kernel32.dll". I don't know what versions of Windows all my customers are using, Probably Win7 - Win11, but some old farts might still be running XP !!! lol!
Again, I'm very grateful
~~~Tracy
The minimum desktop version of Windows that supports the GetBinaryTypeW API function is Windows XP. For servers it is Windows Server 2003.